Range Compression Breakout Strategy Using 30-Bar Highs and Lows
Summary
This strategy defines a range using the highest high and lowest low from the prior 30 candles, then measures its width relative to the sum of those boundaries. When the width falls below a configurable threshold, it enters long on an upside break and short on a downside break. Positions close when price crosses the opposite boundary.
The accompanying example describes polling exchange candles, checking the current position, and placing orders using configured leverage and size. It supplies no performance results or validation. There is also a discrepancy in the short-entry condition: the prose specifies a downward break, while the code checks whether price is below the upper boundary, which does not establish a break below the lower boundary. Execution, slippage, fees, and behavior outside compressed ranges are not evaluated.
Key ideas
- The range boundaries are the highest high and lowest low over the previous 30 candles.
- Range width is normalized by the sum of the two boundaries and compared with a threshold.
- A narrow range enables entries when price breaks beyond a boundary.
- The written short rule and the code's short-entry condition do not match.
- The document provides no backtest evidence or treatment of trading costs.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.