EMA went crazy

Khan
Posts: 137
Joined: Wed Feb 22, 2023 10:21 am

Re: EMA went crazy

Post by Khan »

Don't worry about it; this looks like an edge case and like I said I'm not in a hurry. I did not start a new backtest because I want to keep going, so that's kinda on me and it is going okay even with the bug.

My GMT offset surely has an effect because I noticed that EMA becoming zero bug now mostly happens at 22:00 and 23:00, which are the last two candles of a day and the next day starts at 03:00. You might want to look at whether there is really a 3 hours gap in the data. It might be that the code is skipping 3 hours due to the GMT offset.

Edit:
chart.png
chart.png (38.07 KiB) Viewed 17631 times
I marked the bugged candles - they are all 22:00 candles. You can see the bugged EMA below them.

Backtest attached. This time I missed the bugged candle but you can rewind and see for yourself.
Attachments
GER30.zip
(328.2 KiB) Downloaded 678 times
Khan
Posts: 137
Joined: Wed Feb 22, 2023 10:21 am

Re: EMA went crazy

Post by Khan »

Here's another backtest file with the same bug.

Same pair and same settings, except I dropped down to M5 for my trading. Step size is still M1.
chart.png
chart.png (37.83 KiB) Viewed 17426 times
Backtest file is at this point, where everything is normal.
chart_bug.png
chart_bug.png (23.95 KiB) Viewed 17426 times
Step forward 5 times to close the candle and you'll see this.
Attachments
GER30.zip
(804.01 KiB) Downloaded 656 times
NakedMarkets
Posts: 251
Joined: Tue Feb 22, 2022 11:06 am

Re: EMA went crazy

Post by NakedMarkets »

Hi Khan,

Thanks for your backtest file and your post,
This bug has been identified and has been (hopefully) patched definitively.
The update including the fix should be release this week-end,
We will give more details on this bug when released,

Again, thanks a lot for your help and sorry for the inconvenience !
Admin
Site Admin
Posts: 194
Joined: Mon Feb 21, 2022 3:03 pm

Re: EMA went crazy

Post by Admin »

Thanks for your report, this bug has been fixed in the last update.
For information, the bug was triggered by some specific conditions in the data gap, when displaying the candle in progress with GMT shifting.
Indeed, when a data gap occured, with a hole in the M30 data but not in the H1 data (due to the GMT shift as an example), the value of the last candle in progress (with the step lower than the chart timeframe) was wrong.
It was displayed only during this short period of time.
For information, if you refreshed your chart (by selecting the same timeframe), the next minute was fixing the issue.

Again, we are very sorry for missing the complete fix the first time, the issue was a bit more complex and unusual than expected.
Now, your backtest file is used in our unit tests to ensure that this bug will never come back.

Thanks !
Khan
Posts: 137
Joined: Wed Feb 22, 2023 10:21 am

Re: EMA went crazy

Post by Khan »

Understood, thanks. No need to be sorry; it was an edge case.

Just a note: time remaining on the candle bug is still there - yesterday I saw 4 hours remaining on a M5 candle. I'll hopefully catch it and create a new bug report.

Thanks for the effort and the numerous bug fixes with the latests release!
Post Reply