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

Back to topics list To post a new topic, please log in or register
avatar
4
digisoft 2015.06.09 21: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 !

avatar
Moderator
3206
angevoyageur 2015.06.09 22:28 #
 
avatar
13009
WHRoeder 2015.06.09 22: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() );
avatar
4
digisoft 2015.06.09 23:22 #
 

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


Thank you.

Back to topics list  

To add comments, please log in or register