I want to put a piece of code into my strategy that check to see if the High of a series of bars is under a certain price.
The strategy looks for a 3 bar bearish candle pattern that I have defined, then looks for a similar 3 bar bullish candle pattern. In between these 3 bar patterns I have it coded to be a maximum of 8 candlesticks. If there are 1-8 candles between the two patterns it draws a rectangle around all of the candles.
Now what I want to do is make sure that the potentially up to 8 candles in-between the two 3-bar candle patterns do not exceed a maximum price.
The problem I am having is that some of the time there are 8 candles in between, but sometimes there are 3 or 4 or any number 1-8.
What would the code look like to check the highs of those in between candles given that the number of candles I am looking at can vary?
Thank you,
Nick
Comment