How can I get data from time frame different from period setting in strategy tester (MT4)

 

Hello

I want to know how can I get data from other time frame that strategy tester period settings. for example this code get open and MA at current time frame and M5 and only return data for current time frame when period in strategy tester choose any time except M5 . 

void OnTick()

  {

   string print="\n\n\n\n\n\n"+

                "\n o1= " + Open[0] +

                "\n o2= " + iOpen(NULL,PERIOD_CURRENT,0) +

                "\n o3= " + 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);

  }

The Fundamentals of Testing in MetaTrader 5
The Fundamentals of Testing in MetaTrader 5
  • www.mql5.com
The idea of ​​automated trading is appealing by the fact that the trading robot can work non-stop for 24 hours a day, seven days a week. The robot does not get tired, doubtful or scared, it's is totally free from any psychological problems. It is sufficient enough to clearly formalize the trading rules and implement them in the algorithms, and...
Files:
000.JPG  57 kb
 
Please edit your post and
use the code button (Alt+S) when pasting code