SPY (SPDR S&P 500 ETF) EMA(30)/EMA(70) and EMA(10)/EMA(20) crossover strategy - with 4.0x leverage via call options

Backtest a SPY (SPDR S&P 500 ETF) crossover strategy: it buys when 30-day EMA crosses above 70-day EMA by 1.0% of the stock price, it sells when 10-day EMA falls below 20-day EMA by 1.5% of the stock price. Uses 4.0x leverage via call options with 4.0% annual time decay. Uninvested cash earns 4.0% risk-free interest.

Backtest Assumptions and Key Details

  • If the strategy involves regular stock positions, we use the adjusted close price for backtesting. This reflects total return by incorporating dividends.
  • If the strategy uses call options to simulate leveraged exposure, we instead use the close price (not adjusted), because dividends are not received when holding options.
  • When using call options, we simulate time decay in a simplified way. You can specify a time decay rate (e.g., 3%), which means that if the stock price stays flat for one year, the strategy loses 3% of the current stock price per share of exposure due to decay.
  • If leverage is applied via margin borrowing, we enforce a 25% maintenance margin requirement (as set by FINRA). This places a hard cap at 4x leverage, beyond which a margin call is immediate. In practice, 3x leverage is the more realistic limit, since the risk of a margin call increases sharply beyond that.
  • All trades are assumed to execute at the closing price on the day a signal occurs.
  • The backtest includes realistic cash flow effects, such as interest earned on idle cash and borrowing costs incurred when using margin.

Performance Overview

Portfolio Value Trend (Normalized)

1993-01-29 - $10,000.00 2025-07-05 - $11,507,270.31

Over 32.43 years, portfolio value grew from $10,000.00 to $11,507,270.31.

Beginning with an initial investment of $10,000.00 on 1993-01-29, the portfolio value reached a value of $11,507,270.31 by 2025-07-05. This represents a 114,972.70% total gain over 32.43 years, equivalent to 24.28% annualized. This is a very strong return โ€” significantly above what is commonly seen in broad-market performance. It often signals a well-timed entry into a high-growth phase.

Drawdown and Risk

The maximum drawdown recorded during this period was 42.58%. This drawdown began after a peak portfolio value of $601,167.61 on 2011-04-29, and reached its lowest point on 2012-06-04 when the portfolio value fell to $345,180.46. The drawdown lasted for 402 days.

Maximum Drawdown

๐Ÿ“ˆ 2011-04-29 - $601,167.61 ๐Ÿ“‰ 2012-06-04 - $345,180.46

Max drawdown: 42.58% over 402 days.

The drawdown was moderate and aligns with the type of volatility observed in many broad market assets over extended periods. The maximum drawdown lasted over a year, indicating an extended period of underperformance. This duration is typical of major corrections or bear markets.

The Calmar Ratio โ€” annualized return divided by maximum drawdown โ€” was 0.57, reflecting the tradeoff between return and volatility. A strong ratio that reflects a healthy balance between return and drawdown. This level is above average for most equity-based strategies.

What the Strategy Suggests Today

The 30-day EMA is $600.54, and the 70-day EMA is $587.40, for a difference of $13.14. The current stock price is $625.34, and 1.0% of that is $6.25. Since the difference is sufficient and exceeds the threshold, the buy signal is active.

The 10-day EMA is $613.87, and the 20-day EMA is $606.58, for a difference of $7.29. The current stock price is $625.34, and 1.5% of that is $9.38. Since the difference is insufficient and does not exceed the threshold, the sell signal is not active.

If you have been following this strategy, you are currently holding stocks or call options. No sell signal is active. The strategy suggests continuing to hold the current position.

Transaction Timeline

We began our backtest on 1993-01-29 with $10,000.00 starting capital.

On 1994-09-01, the 30-day EMA at $46.55 crossed above the 70-day EMA at $46.06, exceeding it by 1% of the stock price ($47.50). We invested $10,642.62 โ€” which includes $642.62 in interest earned while holding cash for 580 days โ€” gaining exposure to 896.22 equivalent shares.

On 1998-08-11, the 10-day EMA at $109.77 fell below the 20-day EMA at $111.52 by 1.5% of the stock price ($106.88), triggering our exit. After holding the position for 1440 days, we exited leaving $56,736.80 in available cash.

On 1998-11-11, the 30-day EMA at $108.18 crossed above the 70-day EMA at $107.03, exceeding it by 1% of the stock price ($112.25). We invested $57,300.09 โ€” which includes $563.29 in interest earned while holding cash for 92 days โ€” gaining exposure to 2,041.87 equivalent shares.

On 2000-10-11, the 10-day EMA at $140.97 fell below the 20-day EMA at $143.06 by 1.5% of the stock price ($136.53), triggering our exit. After holding the position for 700 days, we exited leaving $88,986.79 in available cash.

On 2003-04-30, the 30-day EMA at $88.91 crossed above the 70-day EMA at $87.92, exceeding it by 1% of the stock price ($91.91). We invested $98,342.98 โ€” which includes $9,356.19 in interest earned while holding cash for 931 days โ€” gaining exposure to 4,279.97 equivalent shares.

On 2007-11-26, the 10-day EMA at $144.48 fell below the 20-day EMA at $146.64 by 1.5% of the stock price ($140.95), triggering our exit. After holding the position for 1671 days, we exited leaving $230,918.18 in available cash.

On 2009-05-06, the 30-day EMA at $85.27 crossed above the 70-day EMA at $84.17, exceeding it by 1% of the stock price ($92.14). We invested $244,362.83 โ€” which includes $13,444.65 in interest earned while holding cash for 527 days โ€” gaining exposure to 10,608.33 equivalent shares.

On 2010-05-20, the 10-day EMA at $113.22 fell below the 20-day EMA at $115.10 by 1.5% of the stock price ($107.54), triggering our exit. After holding the position for 379 days, we exited leaving $367,130.16 in available cash.

On 2010-10-05, the 30-day EMA at $112.42 crossed above the 70-day EMA at $111.25, exceeding it by 1% of the stock price ($116.04). We invested $372,611.11 โ€” which includes $5,480.94 in interest earned while holding cash for 138 days โ€” gaining exposure to 12,844.23 equivalent shares.

On 2011-08-05, the 10-day EMA at $126.35 fell below the 20-day EMA at $128.60 by 1.5% of the stock price ($120.08), triggering our exit. After holding the position for 304 days, we exited leaving $375,044.39 in available cash.

On 2012-01-10, the 30-day EMA at $125.30 crossed above the 70-day EMA at $123.95, exceeding it by 1% of the stock price ($129.13). We invested $381,461.85 โ€” which includes $6,417.46 in interest earned while holding cash for 158 days โ€” gaining exposure to 11,816.37 equivalent shares.

On 2015-08-25, the 10-day EMA at $200.44 fell below the 20-day EMA at $204.32 by 1.5% of the stock price ($187.27), triggering our exit. After holding the position for 1323 days, we exited leaving $835,538.37 in available cash.

On 2016-04-05, the 30-day EMA at $201.57 crossed above the 70-day EMA at $199.48, exceeding it by 1% of the stock price ($204.19). We invested $855,879.84 โ€” which includes $20,341.47 in interest earned while holding cash for 224 days โ€” gaining exposure to 16,766.34 equivalent shares.

On 2018-10-24, the 10-day EMA at $275.52 fell below the 20-day EMA at $279.61 by 1.5% of the stock price ($265.32), triggering our exit. After holding the position for 932 days, we exited leaving $1,520,446.58 in available cash.

On 2019-02-28, the 30-day EMA at $272.12 crossed above the 70-day EMA at $269.31, exceeding it by 1% of the stock price ($278.68). We invested $1,541,323.86 โ€” which includes $20,877.27 in interest earned while holding cash for 127 days โ€” gaining exposure to 22,123.21 equivalent shares.

On 2020-03-02, the 10-day EMA at $315.02 fell below the 20-day EMA at $321.34 by 1.5% of the stock price ($309.09), triggering our exit. After holding the position for 368 days, we exited leaving $1,965,579.98 in available cash.

On 2020-06-04, the 30-day EMA at $294.40 crossed above the 70-day EMA at $291.13, exceeding it by 1% of the stock price ($311.36). We invested $1,985,520.96 โ€” which includes $19,940.98 in interest earned while holding cash for 94 days โ€” gaining exposure to 25,507.72 equivalent shares.

On 2022-01-25, the 10-day EMA at $449.95 fell below the 20-day EMA at $457.20 by 1.5% of the stock price ($434.47), triggering our exit. After holding the position for 600 days, we exited leaving $4,597,227.40 in available cash.

On 2023-02-03, the 30-day EMA at $398.17 crossed above the 70-day EMA at $393.61, exceeding it by 1% of the stock price ($412.35). We invested $4,785,614.79 โ€” which includes $188,387.39 in interest earned while holding cash for 374 days โ€” gaining exposure to 46,422.84 equivalent shares.

On 2025-03-11, the 10-day EMA at $576.10 fell below the 20-day EMA at $585.32 by 1.5% of the stock price ($555.92), triggering our exit. After holding the position for 767 days, we exited leaving $9,807,173.20 in available cash.

On 2025-06-06, the 30-day EMA at $580.20 crossed above the 70-day EMA at $573.73, exceeding it by 1% of the stock price ($599.14). We invested $9,899,223.99 โ€” which includes $92,050.79 in interest earned while holding cash for 87 days โ€” gaining exposure to 66,089.55 equivalent shares.

As of 2025-07-05, we hold an options position equivalent to 66,089.55 shares using call options (leveraged exposure). The net liquidation value of $11,507,270.31 accounts for all time decay costs.