SuperTrend Long Entries Filtered by a Moving Average
Summary
This strategy builds a SuperTrend direction line from the average true range (ATR), using either the built-in ATR calculation or a simple moving average of true range. The trend switches when price crosses the prior trailing band. A long entry is signaled when direction turns upward and the close is above a separate moving average; an exit and short entry are signaled when direction turns downward and the close is below that average. The script also supports configurable ATR and average periods, chart highlighting, and a date window for entries.
The document supplies source code but no performance results or evaluation of assets, timeframes, transaction costs, or risk-adjusted returns. Its title emphasizes a long strategy, although the source also opens short positions. The moving average condition is applied to both direction changes, while closing an existing long is tied to the sell signal. These implementation details matter when interpreting or testing the strategy; the listed rules alone do not establish profitability.
Key ideas
- The SuperTrend bands use ATR to adapt their distance from price to recent volatility.
- A trend change is signaled when price crosses the prior band.
- Long entries require an upward trend change and a close above a simple moving average.
- The source also opens a short position on a downward trend change with price below the average.
- The document provides code but no reported backtest evidence or trading-cost analysis.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.