Download MetaTrader 5

How to get ChartID's in Strategy Tester ?

To add comments, please log in or register
waza123
125
waza123  

When I use a several pairs and run it in strategy tester, the two window will be created, EURUSD D1 and USDJPY D1:

MqlRates d1[];
ArraySetAsSeries(d1, true);
CopyRates("EURUSD", PERIOD_D1, 0, count_bars+1 ,d1);

MqlRates d2[];
ArraySetAsSeries(d2, true);
CopyRates("USDJPY", PERIOD_D1, 0, count_bars+1 ,d2);



How to get the ChartID for created windows ?


Thanks

Stanislav Korotky
18237
Stanislav Korotky  
waza123:

When I use a several pairs and run it in strategy tester, the two window will be created, EURUSD D1 and USDJPY D1:

MqlRates d1[];
ArraySetAsSeries(d1, true);
CopyRates("EURUSD", PERIOD_D1, 0, count_bars+1 ,d1);

MqlRates d2[];
ArraySetAsSeries(d2, true);
CopyRates("USDJPY", PERIOD_D1, 0, count_bars+1 ,d2);



How to get the ChartID for created windows ?


Thanks

Why do you assume that calling CopyRates should open charts for corresponding symbol in the tester? I don't think it works like this.
Alain Verleyen
Moderator
31184
Alain Verleyen  
marketeer:
Why do you assume that calling CopyRates should open charts for corresponding symbol in the tester? I don't think it works like this.
Yes it is.
Alain Verleyen
Moderator
31184
Alain Verleyen  
waza123:

When I use a several pairs and run it in strategy tester, the two window will be created, EURUSD D1 and USDJPY D1:

MqlRates d1[];
ArraySetAsSeries(d1, true);
CopyRates("EURUSD", PERIOD_D1, 0, count_bars+1 ,d1);

MqlRates d2[];
ArraySetAsSeries(d2, true);
CopyRates("USDJPY", PERIOD_D1, 0, count_bars+1 ,d2);



How to get the ChartID for created windows ?


Thanks

I don't think you can. You only have access to the current chart (the one you set by choosing Symbol/Period in the Strategy Tester).

By the way, what to do ?

waza123
125
waza123  
angevoyageur:

I don't think you can. You only have access to the current chart (the one you set by choosing Symbol/Period in the Strategy Tester).

By the way, what to do ?

sad.

i just want to draw my lines and texts on both charts.

Stanislav Korotky
18237
Stanislav Korotky  
angevoyageur:
Yes it is.
Any reference for this?
Alain Verleyen
Moderator
31184
Alain Verleyen  
marketeer:
Any reference for this?
Just try it. I don't know if it's documented somewhere.
To add comments, please log in or register