Having wired Moving Average problem while creating EA.. - page 4

 
angevoyageur:

Please don't reply inside the quote. As you see, when I want to quote you it's now empty.

The algorithm is good for SMMA, you have to begin somewhere. But you point the origin of the problem, as SMMA is build on the previous value, it's sensitive to the start condition. As you don't have the same start candle on a live chart and with the Strategy tester that explains the different values.

The same is true for EMA, after a second checking (on D1) I now have different values too, as for SMMA.

Well in exponential moving average the difference gets quickly diluted as the most recent frames have the most significant weight. (so i can extend slightly the test to the past and the problem disappears). With smma the problem is much more visible.

It is good to know the nature of the issue for the future though. 

 

If you have time please look into the iCustom function. I attached source code to easily test it. Check any lower TFs that PERIOD_D1 - iCustom works fine and return same values as iMA. In PERIOD_D1 it is always zeros for iCustom, while iMA still reports some values.

I don't have problem with iCustom ma, it works, and always report the same value as iMA.

 
angreeee:

Well in exponential moving average the difference gets quickly diluted as the most recent frames has the most significant weight. (so i can extend slightly the test to the past and the problem disappears). With smma the problem is much more visible.

It is good to know the nature of the issue for the future though. 

Yes, thank you for this useful topic. I think it's clear now (and you ticket isn't useful ?).
 
angevoyageur:

I don't have problem with iCustom ma, it works, and always report the same value as iMA.

Well you have seen my screenshots - for me with PERIOD_D1 its not working but that is a case for another thread I think.

Files:
 
angevoyageur:
Yes, thank you for this useful topic. I think it's clear now (and you ticket isn't useful ?).

Yes i will comment inside the ticket that the issue is true, but it has more with the nature of SMMA math. The only way is to reduce MA PERIOD to some small value, dont use SMMA at all or start back-tests few years before the actual strategy start. 

I still think which I will choose for my EA.

 
angevoyageur:
Yes, thank you for this useful topic. I think it's clear now (and you ticket isn't useful ?).
 Maybe a good idea would be adding older 1M, 15M or bigger opening data candles to the tested period in the past as a resource for iMA(as an option) to have more accurate SMMA and EMA results? Like "use this option if you use SMMA or EMA". IDK. It is up to developers.
Reason: