I want to know How can I get data from a time frame other than period setting in Strategy Tester (a part of MetaTrader4 Trading Terminal), using the sample code below, I get zero results for op2
& EMA2
whenever I choose a period setting other than M5
in the Strategy Tester.
How can I fix it?
void OnTick()
{
string print = "\n\n\n\n\n\n" +
"\n op1= " + iOpen(NULL,PERIOD_CURRENT,0) +
"\n op2= " + iOpen(NULL,PERIOD_M5,0) +
"\n EMA1 : " + iMA(NULL,PERIOD_CURRENT,21,0,MODE_EMA,PRICE_CLOSE,0) +
"\n EMA2 : " + iMA(NULL,PERIOD_M5,21,0,MODE_EMA,PRICE_CLOSE,0);
Comment(print);
}