Skip to content
All library documents

Swing-Pivot Breakouts with ATR-Distance Stops and Risk-Reward Targets

Article TradingView scripts

Summary

This strategy tracks confirmed pivot highs and lows over a configurable swing period. A breakout is triggered when price exceeds the latest active pivot, using either candle wicks or closing prices; each pivot can trigger only once. Entries are evaluated at bar close and are allowed only while the script considers itself out of a trade.

Stops are placed using a distance based on the current close and a 14-period average true range offset from the bar’s low for longs or high for shorts. A take-profit is set at a configurable risk-reward multiple of that distance. The script includes optional inputs for percentage stops, targets, and risk sizing, but those inputs are not used in the order logic; the stop-type selector is also unused. The document provides no backtest results, costs, or market-specific evaluation, so it establishes the rules but not their effectiveness. Pivot confirmation is delayed by the lookback, and the fixed unit sizing may not represent consistent account risk across instruments.

Key ideas

  • The strategy detects pivot highs and lows using a configurable swing period.
  • Breakouts can be defined by wicks or closing prices and consume the active pivot after triggering.
  • Entries are checked at candle close and restricted to one open trade according to the script state.
  • ATR-based stop distances determine both stop placement and a risk-reward-multiple target.
  • Several optional risk controls are declared but are not connected to the order logic.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.