Download MetaTrader 5

Wrong TimeCurrent()?

To add comments, please log in or register
Jinsong Zhang
16606
Jinsong Zhang  

 I try Print(TimeCurrent()); but it seem not right, please see pic:

 

Why? 

Jinsong Zhang
16606
Jinsong Zhang  

And, when I try it in "D1" timeframe, the script don't work until remove it.

Alexey Da
Moderator
6620
Alexey Da  

1. Read help topic https://www.mql5.com/en/docs/dateandtime/timecurrent

2. Did you get some errors in Experts journal in your client terminal?
Documentation on MQL5: Date and Time / TimeCurrent
  • www.mql5.com
Date and Time / TimeCurrent - Documentation on MQL5
Jinsong Zhang
16606
Jinsong Zhang  
alexvd:

1. Read help topic https://www.mql5.com/en/docs/dateandtime/timecurrent

2. Did you get some errors in Experts journal in your client terminal?
There are no any error message in Journal at that time.
Alexey Da
Moderator
6620
Alexey Da  

Unfortunatelly I can not reproduce your situation. 

Try to run this EA.

//+------------------------------------------------------------------+
//|                                            TimeCurrentOnTick.mq5 |
//|                                  2009, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "2009, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
   Print(TimeCurrent());
  }
//+------------------------------------------------------------------+

 

 

To add comments, please log in or register