SuperTrend Futures Strategy with ATR Bands and Position-State Execution
Summary
This tutorial implements a SuperTrend strategy for a BTC futures contract. It calculates ATR-based upper and lower bands around the midpoint of each bar, then carries forward adjusted bands to define the active trend line. A change in which side of the line is active provides entry signals; the strategy closes an existing position before opening a position in the opposite direction. The example uses 15-minute bars and provides configurable ATR period, multiplier, order size, contract, and price tick.
The document includes backtest configuration but gives no performance results, comparison, or risk-adjusted evidence. Its code also handles order placement, cancellation, position checks, and chart annotations, so execution behavior depends on the exchange interface and available liquidity. The example’s settings and parameters are illustrative; they do not establish that the signal is profitable or suitable across markets. The ATR bands can lag, and trend-switch signals may be unreliable in sideways conditions.
Key ideas
- SuperTrend bands are built from the bar midpoint plus and minus a multiple of ATR.
- The active band is adjusted using prior band values and closing prices.
- A switch in the active SuperTrend line triggers a position reversal or a new position.
- The example includes futures order and position handling as well as signal calculations.
- The document supplies backtest settings but no results to establish strategy performance.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.