Two-Bar Breakouts Filtered by an EMA Trend
Summary
This system combines a short-term range breakout with a trend filter. It calculates the highest high and lowest low across the prior two candles, then uses a 50-period exponential moving average to classify direction: closes above the average permit long breakouts, and closes below it permit short breakouts. A long signal occurs when the current high exceeds the prior two-bar high; a short signal occurs when the current low falls below the prior two-bar low. Opposite-side breaks of that same two-bar range close an open position, and signals can reverse the position.
The script provides explicit rules for entries, exits, plotted signals, and alerts, making the approach straightforward to inspect and automate. However, the document supplies no market, timeframe, transaction cost assumptions, stop-loss beyond the range-based exit, or backtest results. The description’s characterization of the strategy as momentum-oriented is an intended rationale, not empirical evidence. Whether the two-bar trigger and EMA filter work together well will depend on instrument, bar size, execution, and testing choices.
Key ideas
- The entry trigger is a break above or below the previous two candles’ range.
- A close above the 50-period EMA permits long signals, while a close below it permits short signals.
- Positions exit when price breaks the opposite edge of the two-bar range.
- The rules allow closing and reversing an existing position when an opposing signal appears.
- No backtest results, market, or timeframe are supplied to establish performance.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.