ATR-Based SuperTrend Direction Changes for Futures Trading
Summary
This strategy calculates an Average True Range from recent high, low, and prior-close values, then places upper and lower bands around the bar midpoint using a multiplier. The bands are carried forward according to prior price and trend state. A close beyond the opposite trailing band changes the direction; the script then opens a position in the new direction and attempts to close an existing position first. The listed settings use a factor of 3, an ATR period of 7, and an order volume of 10.
The document provides Python source and a BTC/USD futures configuration using 15-minute bars over the stated early-2020 period, but includes no reported returns or evaluation. The loop checks for a newly completed bar and evaluates records excluding the still-forming bar. Order sizes differ by direction: the short order uses twice the configured volume, while the long uses the configured amount. The script also does not show a separate stop order tied to the calculated SuperTrend line, despite logging that level. Execution, sizing, and signal behavior should be reviewed and tested under realistic fees and slippage assumptions.
Key ideas
- The SuperTrend bands are built from the bar midpoint and an ATR scaled by a configurable factor.
- The trend state changes when price crosses the trailing band on the opposite side.
- The script checks completed 15-minute bars and enters after a detected direction flip.
- Long and short order sizes are asymmetric in the supplied source.
- The calculated trailing line is logged, but no distinct stop order using that line is shown; no performance results are reported.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.