Skip to content
All library documents

Filtered Long-Only SPY Strategy Using the 50-Day and 200-Day EMAs

Article TradingView scripts

Summary

This strategy trades SPY long when its 50-day EMA is above its 200-day EMA following a bullish crossover. Entry is allowed for a limited period after that cross, and requires the moving averages to be separated by a minimum amount and the slow EMA to meet a slope threshold. Position size targets a configurable multiple of current equity, with a fixed percentage stop. A bearish crossover closes the position; the strategy does not open short trades.

The author reports a high annualized return and a substantial maximum drawdown over a stated historical period, and suggests reducing leverage to lower risk at the cost of returns. These are claims in the document rather than independently validated results. The strategy is specifically presented for daily SPY data, and performance may be sensitive to leverage, stop behavior, parameter choices, execution assumptions, and the historical sample. The provided code does not include transaction-cost modeling.

Key ideas

  • The strategy enters long when the 50-day EMA exceeds the 200-day EMA within a configurable window after a bullish crossover.
  • Minimum moving-average separation and slow-EMA slope filters qualify entries.
  • Position size scales with account equity and a leverage setting, while a fixed percentage stop limits losses.
  • A bearish EMA crossover closes the long position, and the strategy has no short entry rule.
  • The reported historical returns come from the author’s description and include a large drawdown; transaction costs are not modeled.

Tags

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