Skip to content
All library documents

Swing-Level Breakouts with ATR-Based Stops and Risk-Reward Targets

Article Strategy library · Author: giantoilet

Summary

This script defines breakout signals from confirmed swing highs and lows. A swing is detected using a configurable lookback length, and the trader can choose whether a breakout is measured by candle wicks or closing prices. Long signals occur when price breaks above an active swing high; short signals occur when it breaks below an active swing low. Entries are evaluated at confirmed candle closes, and the script limits itself to one active trade at a time.

Stops are calculated using a distance based on the average true range and recent bar extremes. Profit targets are set using a configurable risk-reward multiple of that stop distance, after which paired stop and limit exits are submitted. The source exposes optional percentage risk settings, but these are not used in the shown entry or exit calculations. The document contains no market specification, backtest report, performance statistics, or transaction-cost assumptions, so it describes rules rather than evidence of profitability.

Key ideas

  • The strategy identifies swing highs and lows over a configurable period and trades breaks of those levels.
  • Breakouts can be based on candle wicks or closing prices, with signals confirmed at bar close.
  • An ATR-based distance sets the stop, and a risk-reward multiple determines the target.
  • The strategy permits only one active trade at a time.
  • Optional percentage risk inputs are present but are not used in the shown trade calculations.
  • No performance results or transaction-cost assumptions are included.

Tags

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