Download MetaTrader 5

#property strict warning Possible loss of data due to type conversion

To add comments, please log in or register
Use MQL5 Cloud Network. It is secure!
digisoft
770
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
30730
Alain Verleyen 2015.06.09 20:28  
whroeder1
14503
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
770
digisoft 2015.06.09 21:22  

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


Thank you.

To add comments, please log in or register