Hi,

how to get the actual timestamp - from MT4 for the current candle?

I trying this:



Code
    function tick(){
      var n[20];
      if (lWaitData5)
        lWaitData5=!readActual(5,DATA_M5,nData);
      if (lWaitData15)
        lWaitData15=!readActual(BASE_PER,DATA_M15,nData);

      if (lCanRun && ! lWaitData5 && ! lWaitData15 ){
        // ************************************** Only 1 times / M15 
        // delay 30 - 90 sec
        lCanRun = false;    
        // this date no with begin candle, but actual timestamp
        printf("\nUnix: %d TimeDate: %s  StrDate: %s",utm(wdateBar(0))+1,strdate("%Y-%m-%d %H:%M", wdateBar(0)),strdate("%Y-%m-%d %H:%M", wdate(0)) );
      }	
    }
/---------
void run(){
..
..
//----- begin candle set 
        lWaitData15 = true;
        lWaitData5 = true;
        lCanRun = true;

      // ------- this is OK
      printf("\nUnix: %d TimeDate: %s  StrDate: %s",utm(wdateBar(0))+1,strdate("%Y-%m-%d %H:%M", wdateBar(0)),strdate("%Y-%m-%d %H:%M", wdate(0)) );
}


thanks

Attached Files Screenshot_166.png
Last edited by Grat; 07/25/19 19:22.