Backtest with indicator multicurrencies

 

Hi everyone,


I'm trying to backtest an EA that reads an indicator built with a multicurrency formula, i.e. when it creates the EUR index it calculates all symbols with EUR...


The problem is that it doesn't work well on the strategy tester because the indicator line is drawn badly and the EA fails to read the correct values instead when I checked another similar indicator (bought from mql5 market) everything is fine :- (

If I do the backtest with visualization the indicator draws a line which is totally wrong, if I do it without visualization (the line appears at the end of the backtest) it is not the same as the indicator on the demo/real chart…

Maybe I have to no put #include? Or I must write all symbol "AUDCAD" "EURUSD" etc.... and not by arrays and for cycle? I think no but I cannot to run it in the right way.

Help me please...! Thank you.

Files:
d.jpg  162 kb
 
Milko Vivaldi: Hi everyone, I'm trying to backtest an EA that reads an indicator built with a multicurrency formula, i.e. when it creates the EUR index it calculates all symbols with EUR... The problem is that it doesn't work well on the strategy tester because the indicator line is drawn badly and the EA fails to read the correct values instead when I checked another similar indicator (bought from mql5 market) everything is fine :- ( If I do the backtest with visualization the indicator draws a line which is totally wrong, if I do it without visualization (the line appears at the end of the backtest) it is not the same as the indicator on the demo/real chart… Maybe I have to no put #include? Or I must write all symbol "AUDCAD" "EURUSD" etc.... and not by arrays and for cycle? I think no but I cannot to run it in the right way. Help me please...! Thank you.
We are unable to read your mind nor see your computer. So without detailed information, such source code, log output, etc. we can't really offer much advice.
 
Fernando Carreiro #:
We are unable to read your mind nor see your computer. So without detailed information, such source code, log output, etc. we can't really offer much advice.

Sorry,

I made this indicator (which will probably have more formulas in the switch function in the future but this doesn't change the substance). The problems I encounter are different:

1) if I load the indicator in demo/real on 2 different charts, after a few bars it draws differently

2) if I try to do a backtest with visualization, it draws badly and prints values that are not right

3) this also happens with the indicator downloaded from the web "Currency powerline"....

Now, I don't understand the problem because I don't do repainting and, after the first launch, I only update the zero bar, furthermore in the code there is no reference to _Symbol so the graph it works on has no influence but I see that instead it creates problems.

In the attached files it is noted:

1) the different line on the demo of 2 different charts (file 1)

2) the line during the backtest that flattens out and the one that draws below at the end of the backtest is however different from the one on the demo (file 2)

3) The values of the currency Powerline indicator (attached) installed are always the same in the m not on the strategy tester ..

Is it a mql problem to be investigated or is it MetaTrader4? If I work on 5 maybe it works?

Files:
1.jpg  100 kb
2.jpg  169 kb
3.PNG  241 kb
Prova_1.mq4  12 kb