Download MetaTrader 5
To add comments, please log in or register
Publish your trading signal. Gain access to millions of traders!
SpreadBetta
5
SpreadBetta 2015.09.04 14:12 
I want an EA to run so that at the creation of a new bar the EA iterates through 28 pairs and checks the value of a custom indicator for bars [1] & [2] (i.e. not the current bar that has just been created but the previous two bars).

Unfortunately as I iterate through the pairs it seems that some pairs have generated a new candle and some have not. 

 

   for(int i=0;i<_trading_count;i++)
     {
      string symbol=_trading_pairs[i];

      datetime dt=iTime(symbol,Period(),0);

      PrintFormat("%s %s",symbol,TimeToString(dt, TIME_DATE|TIME_SECONDS));

 

How can I ensure that all pairs have started the new bar?

Thanks in advance
Paul 

Zirkon
123
Zirkon 2015.09.04 14:53  
rcsltd:...

How can I ensure that all pairs have started the new bar?

Thanks in advance
Paul 

By checking the time of the candle, but you can have great differences. It depends of the market, you can sometimes have to wait minutes before the new candle is started in all pairs. On lower timeframes you can also have missing bars.
/
To add comments, please log in or register