Forum

Check for elapsed time?

I would like to repeat a task every 20 seconds is that how to do it? int timeToWaitInSeconds = 20 ; datetime LastTimeRecorded = LONG_MIN ; int OnCalculate ( const int rates_total, const int prev_calculated, const datetime &time[], const double &open[]

Backtest question

Hello I was wondering if spreads were taken into account when backtesting in Metatrader 5

EMA function, what am I doing wrong?

halp double EMA( ENUM_APPLIED_PRICE source, int length, int curBar, const double &_close[], const double &_open[], const double &_SMAbuffer[]) { if (source == PRICE_CLOSE || source == PRICE_HIGH ) { } else { Print ( "ERROR, price applied needs to be close or open." );