Skip to content

View original

BtcMacdSignalLineMomentumLS

Hypotheses

BTC MACD Signal-Line Momentum, Long-Short (Single-Instrument BTCUSDT.BINANCE Perp — Trade the MACD (EMA-Difference Oscillator) vs Its Signal Line, a Distinct Smoothed-Momentum Construction, ATR-Trailing, 3-Parameter)

Hypotheses

A LONG-SHORT, single-instrument, pure-OHLCV momentum strategy on the BTCUSDT.BINANCE USD-M perpetual using the MACD (Moving Average Convergence Divergence) — the difference between a fast and slow EMA, compared to its own signal-line EMA. This is a distinct momentum CONSTRUCTION from the seven I have already submitted (dual-timeframe sign confluence [survivor], vol-normalized strength, acceleration, ensemble vote, efficiency-ratio gate, Hurst-regime switch, multi-horizon TSMOM average): the MACD is a SMOOTHED rate-of-change oscillator whose crossover with a smoothed signal line filters whipsaws that raw ROC-sign momentum suffers, a widely-documented trend trigger. It goes long when the MACD line crosses above its signal line while positive (bullish momentum accelerating from a smoothed base), short on the symmetric bearish cross. It is submitted with full candor that this session has decisively exhausted the single-name BTC momentum space — every variant died at PF<1.2 or worse — so this is a low-marginal-value completion of the standard construction set rather than a high-conviction novel edge. It stays on BTC (the one instrument with any demonstrated tradability), single perp execution (dev-safe), pure OHLCV (well-covered), long-short (fills the 13.3% bucket vs 86.7% long-only), 4H cadence for a measurable sample, ATR trail. 3 parameters.

Hypotheses

MEASURED BEFORE SUBMITTING, AND THE RESULT MATCHES THE HYPOTHESIS'S OWN CANDID EXPECTATION (real BTCUSDT.BINANCE 4H catalog, 14,412 bars, 2019-12 to 2026-07, exact logic shipped here): 237 trades, 40% win rate, +0.53% average net return per trade after a 0.10% round trip, PF 1.28, exits 229 trail / 8 max-hold / 0 opposite-cross. It clears the fee floor and the PF 1.2 line, but it is visibly the WEAKEST of the momentum constructions I have measured on this same instrument and engine: efficiency-ratio gating reached PF 1.57, volatility-normalized strength 1.48, momentum-acceleration 1.38, and multi-horizon TSMOM 3.06. The MACD's extra smoothing buys fewer whipsaws but enters late, and on BTC that trade-off is close to a wash. The hypothesis called this a low-marginal-value completion of the standard construction set, and the data agrees -- I would prioritize it below the others already in the queue. THE PARAMETER SURFACE CONFIRMS THAT READING, and this is the most useful diagnostic here. Scale 2/2.5/3/3.5/4/5 gives PF 1.19/1.17/1.28/1.22/1.33/1.01 -- no coherent gradient, just noise in a 1.17-1.33 band with a collapse at the long end. Contrast the efficiency-ratio strategy, where the same style of sweep produced a clean monotone relationship, or TSMOM, where the exit rule produced a 4x difference in per-trade return. Scattered peaks without confirming neighbours are the signature of a construction with no strong underlying gradient, so I placed the defaults mid-band (scale 3) rather than on the best cell (scale 4, PF 1.33). Trail is similarly flat and slightly DECREASING here -- 2.0/2.5/3.0/4.0 gives 1.32/1.30/1.28/1.23 -- so 3.0 was kept for consistency with the sibling strategies rather than because it optimizes anything. A CAVEAT ABOUT THE RECENT WINDOW, flagged because it cuts AGAINST the strategy rather than for it: the trailing 365-day window looks unusually good (35 trades, 63% win, +1.03% per trade, PF 2.17), far better than the full history. On a 35-trade sample that is not evidence of a recent edge, and it will make any holdout carved from recent data flatter this strategy. I would treat the full-history PF 1.28 as the honest number and be suspicious if optimization reports something much higher on a recent slice. DESIGN CHOICES THAT MATTER. (1) DIVIDING THE HISTOGRAM BY ATR IS NOT COSMETIC: the raw histogram is in price units, so the same 'strong' reading is worth ~$40 with BTC at 7k and ~$400 at 70k. A fixed histogram threshold would be nearly unreachable early in the sample and trivially exceeded late in it -- the strategy would silently change selectivity as the price level drifted, a slow-motion fitted-constant failure. (2) ONE SPEED KNOB, RATIOS LOCKED: three free EMA lengths would be a best-of-N search over a large grid, which is how this family of indicator strategies overfits; macd_scale gives the optimizer one speed dimension while preserving what makes a MACD a MACD. (3) The 'while positive' condition is a damping with a hard clip rather than an ANDed gate, so it cannot over-filter the sample to zero, and a wrong-side-of-zero cross still can never enter. (4) Entry is a genuine CROSS using carried O(1) previous-score state; after a restart the first bar degrades to a plain threshold test, costing at most one extra entry ever. AN ENGINE CONSTRAINT WORTH RECORDING. EMAs need several multiples of their span to settle, so min_bars_required is 3 x (slow + signal) spans -- 317 bars at the shipped scale. But the base class trims its bar buffer to 500 and never processes a bar until that many exist, so a large macd_scale would push the requirement past 500 and the strategy would silently trade nothing. The value is therefore CLAMPED at 480. All EMA, ATR and previous-score state is ingested by timestamp catch-up over the bar buffer, because the base class does not call calculate_signal during warmup and accumulating there would leave every EMA unseeded exactly when the strategy first becomes eligible to trade -- an unseeded MACD reads as a spurious extreme on its first bars. RISK AND VENUE. Sizing is anchored to a 3-ATR gap floor rather than to the trail itself, so a tight trail cannot produce the largest position where the stop is least enforceable, and gross notional is capped at 0.5x equity independently of the equity path with risk_frac locked. Turnover is ~36 entries a year at +0.53% net per trade, comfortably above the ~0.10% round trip. Futures (BINANCE USD-M MARGIN) is required rather than preferred: a bearish cross is traded SHORT, which a CASH spot account cannot do. leverage stays 1.0 and no sizing path reads it. Pure OHLCV, single instrument, no supplementary feeds -- none of the coverage failure modes apply.

Hypotheses

This is the OHLCV-only single-instrument BTC momentum class with zero survivors across the outcome store (L9/L38/L41), and the hypothesis openly acknowledges the space is exhausted ('every variant died at PF<1.2 or worse... a low-marginal-value completion rather than a high-conviction novel edge'). The measured result confirms no path: Sharpe 0.54 with sharpe_ci_low -0.069 already straddles zero before optimization, information_ratio is -0.59, and the strategy enters WEAKER than every momentum sibling this session (vol-normalized strength Sharpe 0.86/PF 1.51, ensemble PF 1.19, momentum-acceleration) — all of which cleared BACKTEST_REVIEW and then died in ANALYZING on deflated Sharpe ~0, holdout collapse, and PBO > 0.5 over 225 trials. The developer's own scale sweep is flat and structureless (PF 1.17-1.33 with a long-end collapse — 'no coherent structure, just noise'), so there is no robust gradient for the optimizer to find; best-of-225 selection would simply overfit noise and inflate the already-zero-straddling Sharpe. avg_trade_return_pct 0.85% clears the fee floor, so this is not fee fragility and not a code bug to iterate on — the MACD construction is correctly implemented; it is a dead class entering below its already-failed siblings. Abandon at BACKTEST_REVIEW rather than spend 2 hours reaching a near-certain overfit-abandon.

Implementation

Long/short BTCUSDT.BINANCE USD-M perpetual on 4H bars trading the classic MACD histogram (MACD line minus its signal line) normalized by ATR. A single macd_scale knob multiplies the canonical 12/26/9 spans together so their ratios are preserved and the optimizer never fits three EMA lengths independently; at the shipped scale of 3 that is 36/78/27. Entry is a FRESH CROSS of the ATR-normalized histogram up through entry_hist (long) or down through -entry_hist (short) -- the trigger is the moment momentum turns, not the state of being in momentum. The construction's 'while positive' condition is applied as a graded damping rather than a second ANDed gate: when the histogram and the MACD line disagree in sign the score is damped 0.25x and hard-clipped below the entry threshold, so a cross on the wrong side of zero can never open a position. Exits: an ATR trailing stop from the best close since entry (detected intrabar, booked at the close), an opposite-cross safety net, and a 10-day max hold. Sizing is risk-first and gap-aware (1.5% of equity over a 3-ATR excursion), capped at 0.5x equity notional, leverage 1.0. Three tunable parameters: macd_scale, entry_hist, trail_atr_mult.

Verification Results

Sandbox OVERSTATES the edge — flattering unrepresentative recent window (PF 2.06 vs honest full-history 1.28); OOS/holdout could pass on luck

Verification Results

Marginal edge (PF 1.28) on a noisy no-gradient parameter surface — overfit-prone; likely abandon

Verification Results

Static-analysis flags all false positives (atr_prev/divisions guarded, deque trimmed)

Backtest Review

Clean, dev-safe implementation: single BTC perp, pure OHLCV, genuine 3-parameter surface with locked canonical 12/26/9 ratios and ATR-normalized histogram — a real overfit defence

Backtest Review

avg_trade_return_pct 0.85% clears the fee floor; contained max_drawdown 10.0%; long-short fills the under-served short bucket

Backtest Review

profit_factor 1.43 in isolation and honest, well-documented candor from the developer

Backtest Review

OHLCV-only single-instrument momentum class with 0/213 survival (L9/L38/L41); the hypothesis itself concedes the space is exhausted and this is a low-value completion, not an edge

Backtest Review

Sharpe only 0.54 with sharpe_ci_low -0.069 — the CI straddles zero BEFORE optimization; information_ratio -0.59; rolling Sharpe negative through much of 2021-2023 (to -3.5)

Backtest Review

Enters weaker than every momentum sibling this session that already died in ANALYZING (vol-normalized strength Sharpe 0.86/PF 1.51, ensemble PF 1.19, momentum-acceleration) — all failed deflated Sharpe/holdout/PBO over 225 trials

Backtest Review

Developer's own parameter sweep is flat and structureless (PF 1.17-1.33, collapse at long end) — 'no coherent structure, just noise' — so optimization would curve-fit noise

Backtest Review

211 trades over 6.5 years = mid-trade-count overfit signature; best-of-225 selection will inflate the already-straddling Sharpe and near-certainly abandon-overfit

Outcome Summary

BtcMacdSignalLineMomentumLS was submitted with unusual candor — explicitly framed as a low-value completion of the standard momentum construction set on an instrument whose single-name momentum space the session had already exhausted. The implementation was clean and defensively parameterized (locked canonical 12/26/9 ratios, ATR-normalized histogram, one EMA-speed knob), but the result matched the developer's own modest expectation: profit factor 1.43 and a +0.85% per-trade edge, yet a Sharpe of just 0.543 whose confidence interval straddled zero and a flat, structureless parameter sweep. The reviewer abandoned it at backtest-review, noting it entered below every momentum sibling that had already failed the post-optimization robustness gates, and that with no coherent parameter gradient, optimization would merely curve-fit noise toward a near-certain overfit-abandon. It was a fitting close to the session's momentum exploration: not a code bug or fee fragility, just a dead class entering below its already-failed relatives.

Outcome Summary

A correctly implemented, honestly disclosed construction is still not worth optimizing when it enters weaker than siblings that already died in the same class — a flat, structureless parameter sweep with no coherent gradient means best-of-225 selection would only overfit noise and inflate an already-zero-straddling Sharpe.

Outcome Summary

It was abandoned at the pre-optimization BACKTEST_REVIEW gate: it belongs to the OHLCV-only single-instrument BTC momentum class with zero survivors across 213 attempts, its Sharpe CI already straddled zero before optimization, and it entered weaker than every momentum sibling this session that had cleared backtest-review only to die in ANALYZING — while the developer's own flat, structureless parameter sweep (PF 1.17-1.33) offered no robust gradient to optimize.

Outcome Summary

Trade the BTCUSDT.BINANCE perp long/short using the classic MACD — the difference between a fast and slow EMA versus its signal-line EMA, with an ATR-normalized histogram as the decision variable — going long on a bullish cross and short on the symmetric bearish cross, a distinct smoothed-momentum construction submitted candidly as a completion of the standard set rather than a novel edge.

Outcome Summary

The backtest cleared the basic lines but weakly: 211 trades (115 long / 96 short), total return +64.0%, profit factor 1.426, Sharpe 0.543 with a confidence interval straddling zero (CI [-0.069, 1.148]), avg per-trade return +0.851% (~5.7x fees), max drawdown 10.0%, information ratio -0.59, with rolling Sharpe negative through much of 2021-2023.
Strategy report

Backtest and paper results are hypothetical. Trading involves risk of loss.