A Three-Candle 123 Strategy with EMA Trend Filters and Timed Exits
Summary
This backtest script implements a long and short version of a three-candle setup called the 123 Stormer strategy. For longs, the first candle must make a higher high and higher low than the second; the third must either make a higher low or, when the option is enabled, form an inside bar. Shorts mirror those conditions. A trend filter checks whether recent prices sit above or below selected fast and slow exponential moving averages, with their direction also considered. The EMAs can be calculated on a selectable timeframe.
Signals schedule stop entries at the third candle’s high or low, then cancel unfilled orders after a configurable bar limit. Exits use a stop beyond the recent three-bar range, a target based on that range and a profit-to-risk input, or a maximum holding period. The script exposes direction, date range, EMA, and timing controls. It provides code and a backtest framework, but the supplied text includes no performance results. Its higher-timeframe EMA requests use lookahead enabled, which can introduce future information into historical calculations and make results unreliable without correction.
Key ideas
- The setup combines a three-candle price pattern with a directional filter based on one or two exponential moving averages.
- The third candle can be required to form an inside bar, or merely continue the pattern’s directional structure.
- Stop entries are placed at the signal candle’s extreme and canceled if not reached within the selected bar limit.
- Stops, range-based profit targets, and a maximum holding duration govern position exits.
- The higher-timeframe EMA requests enable lookahead, creating a material risk of biased historical results.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.