Download MetaTrader 5
To add comments, please log in or register
Enable MQL5 Storage to store your source codes. It is free!
digisoft
558
digisoft 2015.06.09 19:14 

The code:

int candle_time_left = current_bartime + entry_signal_period_seconds - TimeCurrent();

gives warning with #property strict

How should I programm it correct?

Any help appreciated !

Alain Verleyen
Moderator
28648
Alain Verleyen 2015.06.09 20:28  
whroeder1
13640
whroeder1 2015.06.09 20:38  
int candle_time_left =  current_bartime + entry_signal_period_seconds - TimeCurrent() ;
                            datetime    +   int                       - datetime
                                     datetime                         - datetime
 int                 =                                  long // Possible loss of data due to type conversion

a datetime minus a datetime is a long.

int candle_time_left = int( current_bartime + entry_signal_period_seconds - TimeCurrent() );
digisoft
558
digisoft 2015.06.09 21:22  

WHRoeder, you made my day... ;-)


Thank you.

/
To add comments, please log in or register