Multi-Symbol ATR Band Breakout Strategy with Midline Exits
Summary
This teaching example ports a close-based trend strategy into JavaScript and extends it across multiple cryptocurrency futures symbols. It calculates an exponential moving average of typical price as a midline, computes ATR, and places upper and lower bands at a parameterized ATR distance. A close crossing above the upper band opens or reverses to long; a close crossing below the lower band opens or reverses to short. Positions can also close at the midline or at a stop-loss threshold tied to entry price.
The document outlines implementation details for indicator calculation, signal timing, position handling, chart plotting, and parameter configuration. It includes sample parameters and refers to backtest charts, but provides no readable performance statistics or comparison against a benchmark. The author frames the code as a research and learning prototype; live deployment would require additional order sizing, precision, state handling, and tick-level testing. The sample’s fixed order amounts and platform-specific assumptions limit its direct portability.
Key ideas
- The strategy uses an EMA of typical price as a center line and ATR-based upper and lower thresholds.
- A close crossing an outer band triggers entry or reversal in the corresponding direction.
- Positions may exit when price crosses the midline or reaches an entry-based stop-loss level.
- The example processes signals on completed bars and tracks state for each symbol.
- The prototype requires further execution and risk controls before live use.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.