Download MetaTrader 5
To add comments, please log in or register
Having questions? Ask them on the Forum - traders will help you!
digisoft
730
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
30178
Alain Verleyen 2015.06.09 20:28  
whroeder1
14199
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
730
digisoft 2015.06.09 21:22  

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


Thank you.

/
To add comments, please log in or register