GLD Donchian Breakout [Long-Only] — Strategy by mikeshumate
By mikeshumate
Performance Metrics
- Author: mikeshumate
- Symbol: AMEX:GLD
- Timeframe: 1 day
- Net P&L: +2,622.72 USD (+13.11%)
- Win Rate: 52.0%
- Profit Factor: 3.406
- Max Drawdown: 99.37 USD (0.48%)
- Total Trades: 77
Description
LD Donchian Breakout — Long-Only (1D, swing)//// Hypothesis:// Gold (GLD) tends to trend in multi-week moves once a fresh high is printed.// The driver is macro persistence — Fed rate expectations, real-yield regime,// central-bank buying, flight-to-safety flows — which take weeks-to-months// to reprice, not hours. During those episodes a 20-day Donchian break// captures the body of the move without predicting the start.//// When it fails:// * Chop regimes (2013–2015, 2018 mid-year) — breakouts fail and we eat// multiple 1.5–2 ATR stops in sequence.// * "Everything rally" risk-on tapes where real yields fall alongside// equities rallying — gold lags SPX, Donchian whipsaws.// * Fast reversals on macro surprise (surprise hawkish Fed, surprise// de-escalation) — breakouts can reverse inside one session.//// Why it's not just "buy and hold GLD":// We're in-market only during trend episodes. B&H bleeds through chop;// Donchian stays flat through chop and gets paid on trend.//// Viability gate — PROFIT FACTOR is the gate, not absolute net vs B&H:// PF ≥ 1.2, N ≥ 30 trades, acceptable max_dd, net positive.// This strategy's role is UNCORRELATED risk-adjusted return in a// multi-stream portfolio — not single-asset absolute return. A 20%// time-in-market trend system should not be graded against 100%// time-in-market B&H on an asset that happened to rip.//// Strategy:// Entry: close > highest(high, N)[1] — prior N-bar high// AND (optional) 50-SMA rising — trend filter// AND (optional) SPY < SPY 200-SMA — skip risk-on// Exit: close < lowest(low, K)[1] — Donchian exit// OR hard stop at entry − ATR(14) × mult — last-resort floor//// Execution:// Pine emits JSON with action=buy/close, symbol="GLD", sl_pct/tp_pct.// Flask (app.py) sizes a bracket on Alpaca with DAY time-in-force.// The sl_pct / tp_pct in the payload are CONSERVATIVE OUTER LIMITS — Pine's// Donchian exit signal fires first in practice; the Alpaca bracket is a// belt-and-suspenders last-resort in case the close_msg webhook is lost.// Dashboard config (Phase 2 wiring): SL 5% / TP 25% / max_stack 1 / $2K.//// Notes:// * Daily timeframe → zero daytrades consumed, fits alongside PDT.// * Swing hold typically 5–20 bars. Position persists across sessions;// Alpaca holds equity positions indefinitely regardless of order TIF.// * No intraday sizing — strategy runs at daily close only.// * SPX regime filter uses request.security on SPY daily bars (same TF,// no look-ahead risk).//// Backtest (Apr 2026, AMEX:GLD 1D, ~20yr window, $2K notional, comm $1/order)://