how to run strategy tester base on multi-timeframe?

 

my robot is need h1 and h4 and D1 trend in same time, but I cannot any setting for this in strategy tester ,

can you help me?

 
codeidea posted  :

my robot is need h1 and h4 and D1 trend in same time, but I cannot any setting for this in strategy tester ,

can you help me?

 

Hey

you can specify separate timeframes for different indicators

you can also hard-code them 

for example if you need close prices:


CopyRates(Symbol(),PERIOD_H1,0,100,rates_h1);

CopyRates(Symbol(),PERIOD_H4,0,100,rates_h4);

etc..


if you want to make sure that you recalculate your indicators only on new H1 bar and H4 bar and D1 bar

then you might find this post useful:

https://www.mql5.com/en/forum/942


hope that helps


Indicators: isNewBar
  • www.mql5.com
The function saves its time, it's the current bars, the next bar will be new.
 

firehawk: 

but there are graphics object ( like trend) on H4 and D1, I want let robot in H1 to get them, not only the price information.

 

thanks

hongbin.fei 

 

no one can answer?

thanks 

 

So far as I know, MT5's Tester does not support multi-timeframes.