Skip to content
All library documents

Two-Bar Breakouts Filtered by a Moving Average Trend

Article TradingView scripts

Summary

This strategy looks for price to break the high or low formed by the previous two candles, with a 50-period exponential moving average as a directional filter. A long signal requires price above the average and a move above the two-bar high; a short signal requires price below the average and a break beneath the two-bar low. The system closes an open long if price falls through the two-bar low, or closes a short if price rises above the two-bar high. Opposite signals close the existing position before opening the other side, and pyramiding is disabled.

The source includes chart markers and alert conditions for entries and exits, making the rules straightforward to inspect and automate. The document offers no strategy report, market or timeframe specification, transaction cost assumptions, or performance evidence. Because the exit boundaries are recalculated from recent candles, risk per trade can vary with market conditions; there is no stated fixed stop distance, profit target, or position-sizing method. The rules are therefore a simple breakout template, not evidence that the setup is profitable across instruments or periods.

Key ideas

  • The strategy defines its breakout range using the prior two candles.
  • A 50-period EMA filters entries by trend direction.
  • Positions close when price breaks the opposite edge of the recent two-bar range.
  • Opposite entry signals reverse exposure, while pyramiding is disabled.
  • The document gives no backtest results, cost assumptions, or position-sizing rules.

Tags

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