Download MetaTrader 5
To add comments, please log in or register
Publish programs in Code Base. Improve your rating!
karlor 2015.05.18 17:21 


I'm looking for something fairly simple, I believe, but can't seem to

make it work.  Not sure if there's a better way either.


I want to check the close price of the currrent candle with the close price

of previous candles.  If requirement met, put an order in.  This is the code

to check for consecutive down candles (int ConsecutiveBars, global variable):


      int consecutiveDownBars = 0;
      //check for consecutive bars in negative direction;
      for(int i = 0; i < ConsecutiveBars; i++)
         if(Close[i] < Close[i+1])
           { consecutiveDownBars++;
            Alert("consecutiveDownBars incremented"); }



Any help would be appreciated.


To add comments, please log in or register