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

 
angreeee:

i have modified the script according to your guidelines and the problem still persists :(

now it looks like this:

 maybe someone can create draft EA how he would create such MA value generator and I could compare both - test it and isolate the error. (if someone has few minutes to spare)

I am going to check in a sec and reply if the problem is the same on other pairs or is it only this one pair, as this is very strange. 

the difference is not that huge on other pairs as  on this pair - thats why i probably havent noticed it before

I tested on GBP/USD EUR/PLN - the differences there were about 0.0004 so within the measurement-error but on EUR/CHF the difference was ~0.016 and USD/JPY ~0.8

 
angreeee:

the difference is not that huge on other pairs as  on this pair - thats why i probably havent noticed it before

I tested on GBP/USD EUR/PLN - the differences there were about 0.0004 so within the measurement-error but on EUR/CHF the difference was ~0.016 and USD/JPY ~0.8

I can spare some minutes, can you make a summary or do I have to read all the posts ?

The difference between what and what ?

 
angevoyageur:

I can spare some minutes, can you make a summary or do I have to read all the posts ?

The difference between what and what ?

the difference between the ma value generated by the EA (source code on page 1 - ctrl+c ctrl+v to editor to test in yourself - pair GBP/NZD) in strategy tester and the moving average indicator normally placed on the chart.

 

I tried to use iCustom and "custom moving average" external indicator, but ICustom has some issue in MT5 - you cannot use other period than current, so this works:

   custom_ma_temp=iCustom(Symbol(),0,"Examples\\Custom Moving Average", 370, 0, MODE_SMMA,PRICE_OPEN);

 but this doesn't:

   custom_ma_temp=iCustom(Symbol(),PERIOD_D1,"Examples\\Custom Moving Average", 370, 0, MODE_SMMA,PRICE_OPEN);

I discovered this bug before, but i forgot to report it to service desk when i was using custom indicator from the market in the EA. 

 

Back to the issue - now my plan is to create Moving average function inside the EA and compare the iMA and that function results. 

 
angreeee:

the difference between the ma value generated by the EA (source code on page 1 - ctrl+c ctrl+v to editor to test in yourself - pair GBP/NZD) in strategy tester and the moving average indicator normally placed on the chart.

 

I tried to use iCustom and "custom moving average" external indicator, but ICustom has some issue in MT5 - you cannot use other period than current, so this works:

 but this doesn't:

I discovered this bug before, but i forgot to report it to service desk when i was using custom indicator from the market in the EA. 

 

Back to the issue - now my plan is to create Moving average function inside the EA and compare the iMA and that function results. 

Good job, I'm not sure if this is really a platform bug but this is a good way to check.
 

by the way when i testes both iMA and custom moving average on 4H chart

(impossible on 1D as custom generater zeros... i dont know why even though it was "current" timeframe settings)

and the results were identical for all:

1) iMA

2) icustom "custom moving average"

3) moving average put manually on the chart

on 4H chart the ssma370 = 1.9588 

for all 3 of them. So why is it different on D1 chart? :( 

 

EDIT: attaching screenshot so you could clearly see the difference (4H vs 1D)

I guess both of them (iCustom timeframe and iMA issues under D1 timeframe) may be platform problems. I need to investigate and document iCustom issue further before reporting it.
If you don't have any new ideas regarding the iMA issue I will report it in 30+ minutes to the SD.

Files:
ma_problem8.png  227 kb
 
angreeee:

by the way when i testes both iMA and custom moving average on 4H chart

(impossible on 1D as custom generater zeros... i dont know why even though it was "current" timeframe settings)

and the results were identical for all:

1) iMA

2) icustom "custom moving average"

3) moving average put manually on the chart

on 4H chart the ssma370 = 1.9588 

for all 3 of them. So why is it different on D1 chart? :( 

 

EDIT: attaching screenshot so you could clearly see the difference (4H vs 1D)

I guess both of them (iCustom timeframe and iMA issues under D1 timeframe) may be platform problems. I have to report them to the service desk. I need to investigate and document iCustom issue further before reporting it.
If you don't have any new ideas regarding the iMA issue I will report it in 30+ minutes to the SD.

Have you tested with tick by tick tester mode instead of open prices?
 
angreeee:

by the way when i testes both iMA and custom moving average on 4H chart

(impossible on 1D as custom generater zeros... i dont know why even though it was "current" timeframe settings)

Because you don't test the returned value of CopyBuffer. A 370 ma needs an history data of at least 370 days on D1 chart/timeframe which the Strategy Tester doesn't provide.


and the results were identical for all:

1) iMA

2) icustom "custom moving average"

3) moving average put manually on the chart

on 4H chart the ssma370 = 1.9588 

for all 3 of them. So why is it different on D1 chart? :( 

 

EDIT: attaching screenshot so you could clearly see the difference (4H vs 1D)

I guess both of them (iCustom timeframe and iMA issues under D1 timeframe) may be platform problems. I need to investigate and document iCustom issue further before reporting it.
If you don't have any new ideas regarding the iMA issue I will report it in 30+ minutes to the SD.

I have different results with SMMA mode only, on D1 AND H4.
 
angevoyageur:
Because you don't test the returned value of CopyBuffer. A 370 ma needs an history data of at least 370 days on D1 chart/timeframe which the Strategy Tester doesn't provide.


I have different results with SMMA mode only, on D1 AND H4.

I tested more than 2 years so at some point he already has 370 days of history data yet he returns 0 all the time.. but you are right. when I back-tested it from 2010 the values were correct. So i guess when looking for settings i need to perform earlier back-test (like from 2010). My ea has already an option to start at certain date so i will just combine these two options.

Thank You. 

 
figurelli:
Have you tested with tick by tick tester mode instead of open prices?

yes i tested that, but it seems when using such a big number for ma (370) i need to start back-test much earlier as the tester does not provide necessary data for ima function. Good to know for the future. Now i need to check all my strategy presets as they may have same issue regarding ima (many of them are using D1 MAs).

Thanks to both of You for your help.

 
i noticed again even when i run it from 2009 at the current date (04.2014) the difference between the MA on the chart and ima in backtest is still 0.10, so i guess the issue persists. I will do my own iMa replacement function if all other failed. icustom still returns only zeros on D1 chart even when starting at 2009 and working fine on H4 chart.
Reason: