Skip to content
All library documents

Pivot-Based Trendline Breakouts with EMA and ATR Risk Controls

Article Strategy library · Author: kedarcquant

Summary

This strategy builds trendlines from confirmed swing pivots and uses breaks of those lines as trade signals. It stores recent pivot highs and lows, then updates an upward line when the latest two lows form higher lows; the documented code also begins the corresponding downward-line logic using lower highs. A configurable EMA filter is intended to allow longs above the average and shorts below it. The inputs specify pivot confirmation distance, EMA length, ATR-based stop distance, a take-profit expressed as a multiple of the stop, and switches for long and short trades. The script also sets commission and position-sizing assumptions.

The supplied document ends partway through the source, before the breakout conditions and order management are shown. As a result, the actual entry and exit rules cannot be fully verified from the available text. No backtest settings or performance evidence are provided. Pivot confirmation requires later bars, so signals are not known at the pivot itself; the strategy’s timing and behavior would depend on the omitted logic. The available material describes a framework rather than a complete, assessable trading system.

Key ideas

  • The strategy records confirmed pivot highs and lows to construct candidate trendlines.
  • An upward line is refreshed when the two latest pivot lows are higher in sequence.
  • The inputs include an EMA direction filter and ATR-scaled stop and reward settings.
  • The provided source is truncated before the breakout triggers and complete order rules appear.
  • No backtest results are supplied, so the strategy’s performance cannot be assessed from this document.

Tags

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