# Emmanuel MTF — Multi-Timeframe SMA Pullback Strategy

Inspired by [Emmanuel Malyarovich's video](https://www.youtube.com/watch?v=0aCaq-_N3nI) on trading with the 20 and 200 period simple moving averages.

## Core idea

Emmanuel's approach uses only two indicators — the 20 SMA and the 200 SMA — applied across multiple timeframes. The higher timeframe establishes trend direction; the lower timeframe times entries at pullbacks to the 20 SMA.

From the video: *"I like to look for potential entries whenever prices are close to or near the 20 MA"* during an uptrend where the *"20 MA is under price, trending higher."*

## How it works

**4h (trend context):** Confirms a bullish regime — close above the 200 SMA, 20 SMA stacked above the 200 and rising, price above the 20 SMA but not overextended from it.

**15m (entry timing):** Waits for price to retrace to the 15m 20 SMA and bounce. Requires the MA to be rising, price to be in a tight proximity zone just above it, evidence of an actual pullback (low touched the MA recently), and evidence of a prior impulsive move (recent high was meaningfully above the MA — avoids first-touch traps after exhaustion moves).

**Exits:** Trailing exit on a cross below the 15m 20 SMA, a structural exit if the 4h MAs unstack, and a hard stop at 2% below the 15m 20 SMA.

## Adaptation notes

Emmanuel trades US equities intraday, often using gap-up/gap-down catalysts and order flow as additional context. This strategy adapts his SMA logic for crypto (BTC), which trades 24/7 without gaps. The multi-timeframe structure, proximity-based entries, and extension filters are faithful to his described method; the discretionary elements (candle structure, level 2 order flow, gap dynamics) are not expressible in the current DSL.

## Data requirements

Requires backfilled candle data for both **15m** and **4h** intervals across the backtest window.

## Lineage

This strategy evolved through eight single-timeframe iterations (emmanuel-ma v1–v8) before the DSL gained multi-timeframe support. Key learnings from that process: strict cross_over triggers are too rare on higher timeframes; proximity-and-rising entries generate more trades with comparable edge; exit timeframe must match entry timeframe to avoid whipsaw; and the strategy is consistently green but low-conviction without the multi-timeframe layering Emmanuel describes.

**v1 → v2**: Condition audit on a 360-day backtest revealed v1 produced only 1 trade. The fatal bottleneck was condition 11 (not-first-touch filter, 7% pass rate) which misread the transcript — Emmanuel says to SKIP the first touch after a parabolic run, not to require proof of a prior impulse. v2 replaces it with a not-parabolic guard (`close - SMA(20) < SMA(20) * 0.03`) that blocks entry when already extended, which is the scenario Emmanuel actually describes. Also: widened pullback-evidence tolerance from 0.3% to 0.5% (was the next tightest filter at 46.9%); added 4h ADX(14) > 20 to compensate for removed selectivity.

**v2 → v3**: v2 ran 179 trades over 360 days with 19% win rate and profit factor 0.586. All 179 exits were via the trailing cross_under — the strategy had no upside exit, so winners reversed back through the entry zone before closing. Diagnosis: (1) no take-profit exit; (2) cross_under fired on single-bar noise; (3) ADX>20 was too loose at 71.9% pass rate; (4) 4h SMA rising check (offset=5, 20 hours) allowed entries in a turning-flat regime; (5) no candle-body confirmation at entry. v3 adds a take-profit exit at +1.5% above 15m SMA, replaces cross_under with a 0.1%-below-SMA compare, adds `close > open` (bullish candle), tightens 4h SMA rising to offset=2 (8 hours), and raises ADX threshold to 25.

**v3 → v4**: v3 ran 127 trades with 21.26% win rate and profit factor 0.686. Take-profit fired only 11 times (8.7% of exits) — most trades reversed before reaching +1.5%. The 15m conditions all pass at ~50%, indicating entries are happening regardless of whether the 15m is itself in a local bull or bear regime. v4 adds a 15m SMA stack requirement (`SMA(20,15m) > SMA(200,15m)`) for triple timeframe alignment; tightens entry proximity from 0.5% to 0.3%; and lowers the take-profit target from 1.5% to 1.0%.
