Download MetaTrader 5

OnTick() time

To add comments, please log in or register
scarr
126
scarr  

Hi all,

I am trying to back test my EA but when I try to get the time of the tick it keeps returning the actual current time


void OnTick()
  {
//---
      WriteLog(IntegerToString(TimeHour(iTime(NULL,PERIOD_M5,0)))+" "+IntegerToString(TimeMinute(Time[0])));


I have tried but Time[] and iTime[]


Any help anyone?


Steve

Carl Schreiber
7662
Carl Schreiber  

Why don't you use TimeCurrent() (From the reference of the editor: mouse above the function  + F1):

During testing in the Strategy Tester, TimeCurrent() is simulated according to historical data.

Beside that instead of IntegerToString() you can write as well : (string)TimeHour(..)

scarr
126
scarr  

Hi Carl,

TimeCurrent is the Current time isn't it? I want the time the tick occurred so I can use the backtesting.


Steve

Ex Ovo Omnia
3387
Ex Ovo Omnia  
scarr:

Hi Carl,

TimeCurrent is the Current time isn't it? I want the time the tick occurred so I can use the backtesting.


Steve


If you only bother to follow the link Carl has published...
scarr
126
scarr  

Hi Ex Ovo,


I did but misread it :-(  Thanks :-)


Steve

To add comments, please log in or register