Download MetaTrader 5

Error show when i set date on datetime variable

To add comments, please log in or register
Mohammad Ali
21287
Mohammad Ali  

Dear Guys

I wrote a code below :

extern datetime   TradeOpenDate_1          = "2013.01.02 00:00:00";

 

It show warring : implicit conversion from 'string' to 'number' Pending.mq4 81 46

 

How to i am write above code in correct.  Please help me.

Boeing747
241
Boeing747  
capilta:

Dear Guys

I wrote a code below :

 

It show warring : implicit conversion from 'string' to 'number' Pending.mq4 81 46

 

How to i am write above code in correct.  Please help me.


it is right:

extern datetime   TradeOpenDate_1  = D'2013.01.02 00:00:00';


for example in mql4 tutorial:


datetime Alfa = D'2004.01.01 00:00'; // New year
datetime Tim = D'01.01.2004'; // New year
datetime Tims = D'2005.05.12 16:30:45'; // may 12, 2005. 16 h. 30 min 45 sec.
datetime N_3 = D'12.05.2005 16:30:45'; // may 12, 2005. 16 h. 30 min 45 sec.
datetime Compile = D''; // equal to D'[compilation] 00:00:00'

Mohammad Ali
21287
Mohammad Ali  
Boeing747:

it is right:


for example in mql4 tutorial:


datetime Alfa = D'2004.01.01 00:00'; // New year
datetime Tim = D'01.01.2004'; // New year
datetime Tims = D'2005.05.12 16:30:45'; // may 12, 2005. 16 h. 30 min 45 sec.
datetime N_3 = D'12.05.2005 16:30:45'; // may 12, 2005. 16 h. 30 min 45 sec.
datetime Compile = D''; // equal to D'[compilation] 00:00:00'


Thanks . it is working now 

To add comments, please log in or register