Skip to content
All library documents

21-EMA Momentum Flip with Session and Daily Trade Controls

Article Strategy library · Author: ianzeng123

Summary

This rules-based strategy uses price crossings of the 21-period exponential moving average to enter and reverse positions. A close crossing above the EMA triggers a long entry; a close crossing below triggers a short entry. Trades are restricted to a configurable time window, with a stated default of 8:30 to 10:30, and the rules cap activity at five trades per session. Optional take-profit and stop-loss orders are included, and the strategy locks out further trades after a profitable trade. VWAP is displayed as a reference indicator rather than described as an entry filter.

The document explains the approach and lists risks, but supplies no performance evidence. It notes that EMA lag and sideways markets can produce delayed or repeated signals, while fixed exits may not adapt to volatility. The code also tracks trade outcomes and resets its counters at a configured clock time, so its daily control behavior depends on implementation details and should be checked before relying on it. Suggested extensions include volatility-based exits, signal filters, and broader trend context.

Key ideas

  • Price crossing above or below the 21-period EMA triggers entries in the corresponding direction.
  • The strategy can reverse positions when price crosses the EMA in the opposite direction.
  • A session window, trade-count cap, optional exits, and a post-win lockout are intended to constrain trading.
  • VWAP is plotted for context, while the stated entry rules rely on EMA crosses.
  • No performance results are supplied, and lag, choppy conditions, and fixed exit levels are noted limitations.

Tags

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