Pivot-Based Trendline Breakouts with Moving Average and ATR Risk Rules
Summary
This strategy builds an uptrend line from the two latest confirmed higher lows and a downtrend line from the two latest confirmed lower highs. A close crossing above the descending line can trigger a long; a close crossing below the rising line can trigger a short. A moving-average filter can restrict longs to prices above the average and shorts to prices below it. The script also labels the pivots used to construct each line.
Stops and profit targets are set using ATR multiples, with an optional exit when an opposite breakout signal appears. The accompanying description discusses optional higher-timeframe filters and retest entries, but those features are not present in the supplied script, so the described behavior and executable rules do not fully match. Pivots are only confirmed after right-side bars have elapsed, which delays recognition. No backtest results or validation are supplied, and the stated risk settings should be treated as parameters rather than proven performance guidance.
Key ideas
- Two confirmed higher lows define the rising line, while two confirmed lower highs define the descending line.
- Crosses of those lines create candidate long and short signals, subject to an optional moving-average filter.
- ATR-based stops and R-multiple targets set exit levels, with optional closure on an opposite signal.
- Pivot confirmation takes time, so the structure is recognized only after subsequent bars have formed.
- The written description mentions retest and higher-timeframe options that are absent from the supplied code, and no performance evidence is provided.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.