SPY Dip Buyer Margin — Backtest
Strategy 1101 · SPY, long only, 1.8x equity on margin · daily signal, orders at 19:55 ET · Jan 4, 2016 – Nov 17, 2026 · margin accounts, idle money in SGOV
14.0%
Return per year
0.98
Sharpe ratio
−17.8%
Maximum drawdown
107
Trades (~10 per year)
75%
Winning trades
0
Days under the 50% margin requirement
Growth of $10,000
SPY Dip Buyer Margin (1.8x)Buy and hold SPY
Both lines start at $10,000. The strategy line includes margin interest, SGOV income on idle money and trading costs. SPY prices are split- and dividend-adjusted.
Rules
- Signal: z = (close − 5-day average) / 5-day standard deviation, on SPY's daily closes.
- Buy (when flat): z ≤ −1.5 and the close is above its 200-day average.
- Sell (when holding): at the first close where z ≥ +1.5, or 10 trading days have passed, or the close is at least 5% below the entry-day close.
- Re-entry: never on the same day as an exit. Long SPY only.
- Orders: decided after the close, filled at SPY's 19:55 ET price in the extended session.
- Size: 1.8x the account's equity, less a 1% buffer, bought in one order at 19:55 ET. The overnight (Reg T) limit is 2x; 1.8x leaves room above the broker's margin requirement.
- SGOV or SPY, never both: on a buy signal all SGOV is sold first, in the same minute, and SPY is bought only once no SGOV is left. After a SPY exit the cash goes back into SGOV at the next open.
- Idle money: SGOV, bought with cash only and never on margin, so nothing is borrowed while out of SPY.
- Margin requirement: Alpaca can require equity of 50% of the position's value, and warns the same day equity falls below it. At 1.8x, equity starts at 56%.
- Margin guard: if equity falls below 52% of the position's value, sell enough SPY to repay the whole loan.
Results by leverage, Jan 4, 2016 – Nov 17, 2026
| Return per year | Sharpe | Max drawdown | Worst day | Worst trade | Margin interest per year | Lowest equity / position | Guard sales | Days under 50% | |
|---|---|---|---|---|---|---|---|---|---|
| 1x, no margin | 9.1% | 1.13 | −9.9% | −4.4% | −5.4% | 0.00% | 0 | 0 | |
| 1.5x | 12.2% | 1.02 | −14.7% | −6.5% | −8.1% | 0.66% | 64.6% | 0 | 0 |
| 1.8x (as traded) | 14.0% | 0.98 | −17.8% | −7.8% | −9.8% | 1.06% | 52.5% | 0 | 0 |
| 1.8x, idle money in cash earning 0 | 12.5% | 0.89 | −19.5% | −7.8% | −9.8% | 1.06% | 52.5% | 0 | 0 |
| 1.8x, without the margin guard | 14.0% | 0.98 | −17.8% | −7.8% | −9.8% | 1.06% | 52.5% | 0 | 0 |
| 2x (the limit; not traded) | 8.2% | 0.92 | −10.2% | −7.0% | −5.9% | 0.21% | 48.6% | 108 | 4 |
| Buy and hold SPY | 14.4% | 0.86 | −33.8% | −10.8% |
Results since 2023
| Return per year | Sharpe | Max drawdown | Total return | |
|---|---|---|---|---|
| 1x, no margin | 16.2% | 1.81 | −6.0% | +78% |
| 1.5x | 21.9% | 1.62 | −9.7% | +115% |
| 1.8x (as traded) | 25.4% | 1.55 | −11.8% | +140% |
| Buy and hold SPY | 19.9% | 1.28 | −18.8% | +102% |
Results by year (1.8x)
| Year | Strategy | Buy and hold SPY | Strategy drawdown within the year |
|---|---|---|---|
| 2016 | +4.1% | +13.0% | −2.1% |
| 2017 | +14.4% | +21.7% | −3.0% |
| 2018 | −8.6% | −5.0% | −12.0% |
| 2019 | +10.0% | +31.1% | −10.5% |
| 2020 | +16.7% | +18.5% | −11.5% |
| 2021 | +46.8% | +28.6% | −6.9% |
| 2022 | −15.4% | −18.2% | −17.5% |
| 2023 | +14.0% | +26.2% | −11.8% |
| 2024 | +38.1% | +24.9% | −7.1% |
| 2025 | +42.2% | +17.7% | −9.0% |
| 2026 | +7.0% | +8.3% | −7.8% |
Trades (1.8x, as a share of account equity)
| Trades | Win rate | Average trade | Best trade | Worst trade |
|---|---|---|---|---|
| 107 | 75% | +1.29% | +9.7% | −9.8% |
Margin safety
- The lowest equity-to-position ratio in the period was 52.5%, measured at each day's low. The guard acts at 52% and sold 0 times; equity was under the 50% requirement on 0 days.
- At 1.8x, the guard acts after SPY falls about 7% from the entry price, and the 50% requirement is reached after about 11%. The strategy's 5% stop normally closes the trade before either.
- At 2x, equity starts exactly at 50%, so any fall in SPY breaks the requirement: in this backtest the guard would have sold 108 times over 107 trades. A live account at 1.98x got a margin warning on its first day, Nov 17, 2026, which is why the strategy trades at 1.8x.
- The highest leverage reached was 1.86x, on mornings when SPY opened lower after an entry.
Assumptions
- The margin loan costs the Treasury bill rate plus 2.5 points a year, charged for every calendar day. This is an assumption, not Alpaca's quoted rate.
- SPY bought and sold at its 19:55 ET price (the regular close for dates after Oct 30, 2026) at 1.5 basis points per side. SGOV is sold at that day's closing price on a buy, and bought at the prior close on the morning after an exit, at 1 basis point.
- The 50% requirement is what Alpaca applied to one live account; it reports 30% for others. The backtest uses 50% for every account.
- The margin guard is tested against each day's low and sells 0.1% below its trigger price. Prices are Alpaca SIP daily bars, adjusted for splits and dividends.
Risks
- Leverage multiplies losses. Drawdown and the worst day are about 1.8 times the unleveraged version's. A trade stopped out at 5% costs about 9% of equity.
- Gaps. The stop is checked at the close only, and the guard can't sell between 20:00 and 04:00 ET. A fall of about 11% between checks would still put the account under the margin requirement.
- SGOV that can't be sold. If SGOV does not sell at 19:55 ET, the SPY buy is skipped for that signal. The backtest assumes SGOV always sells.
- Margin interest. A higher rate than assumed lowers returns directly.
- After-hours fills. Liquidity at 19:55 ET is thinner than in the regular session, and a limit order may fill only in part.
- Chosen in hindsight. The parameters were picked with this history available; live results are usually weaker than a backtest.
Generated Nov 18, 2026 by spy_dip_buyer/backtest_report.py. Backtests use past prices and simple cost assumptions; past results don't guarantee future returns.