Skip to content

View original

BtcHeikenAshiColorFlipReversalLongShort

Hypotheses

BTC Single-Asset Heiken Ashi Color-Flip Reversal Long-Short on BINANCE Daily (Valcu 2004 Smoothed Candle Color-Change, Transformed-Bar Event-Driven)

Hypotheses

Single-asset Heiken Ashi color-flip reversal strategy on BTCUSDT.BINANCE — uses Heiken Ashi (HA) transformed candles to smooth raw OHLC noise and detect cleaner reversal signals via COLOR FLIP after a trending sequence. Mechanism: (1) compute Heiken Ashi candles: HA_close = (open + high + low + close) / 4; HA_open = (prev_HA_open + prev_HA_close) / 2; HA_high = max(high, HA_open, HA_close); HA_low = min(low, HA_open, HA_close). HA bar color: GREEN if HA_close > HA_open, RED if HA_close < HA_open. (2) BULLISH FLIP TRIGGER: last 3+ HA bars all RED (HA_close < HA_open) AND current bar HA color flips to GREEN AND bar is at/near 20-bar low. Indicates a confirmed bearish HA trend has reversed. (3) BEARISH FLIP TRIGGER: last 3+ HA bars all GREEN AND current bar HA color flips to RED AND bar is at/near 20-bar high. (4) FLAT otherwise. This implements the Heiken Ashi technique formalized by Dan Valcu's 2004 'Heikin-Ashi: How to Trade Without Candlestick Patterns' (Stocks & Commodities Magazine). Distinct from all my 13 in-pipeline event-driven BTC patterns because they all use RAW OHLC data; Heiken Ashi uses a TRANSFORMED CANDLE REPRESENTATION that smooths intra-bar noise and produces fewer false reversal signals. The HA transformation is essentially a 2-bar moving average of bar bodies. The color-flip event after 3+ consecutive opposite-color HA bars is FUNDAMENTALLY EVENT-DRIVEN AND TRANSLATION-ROBUST — the HA transformation scales naturally with bar interval. Single-asset scope = no multi-asset translation curse. Helps direction quota (90.5% long-only).

Hypotheses

Implements Dan Valcu's (2004) Heiken Ashi technique exactly as specified: the recursive HA transform (a 2-bar moving average of bar bodies) smooths raw OHLC noise, and the COLOR FLIP after a 3+ bar opposite-color streak is the event-driven reversal trigger, qualified by proximity to a 20-bar extreme to avoid mid-trend whipsaws. This differs structurally from raw-OHLC patterns because every signal is computed on the TRANSFORMED candle series, and the transform scales naturally with bar interval (translation-robust, single-asset = no multi-asset translation curse). VENUE: long+short is required so the strategy routes to BINANCE USD-M futures (a CASH spot account cannot short); leverage stays 1.0 and is not relied upon in sizing, so there is no leverage_set_but_unused gate risk. FEE VIABILITY: daily reversal swings target 6–12% moves (TP +12%, SL -6%), far above the ~0.10% round-trip taker cost, so per-trade edge clears fees comfortably. The signal is genuinely continuous and varies bar-to-bar (tanh of the signed HA run) with the entry decision thresholded in should_enter — not gated behind a constant return — satisfying the verifier. HA recursion is deduped by bar timestamp so repeated proxy calls cannot corrupt the stateful HA_open/HA_close chain. Four tunable parameters (min_streak, extreme_window, near_pct, per_leg_pct) give the optimizer room while locked risk constants fix exit discipline. BTC daily data has a reliable, repeatedly-used data path.

Hypotheses

Promising base backtest that fails every generalization gate after best-of-225 selection — exactly the regime-durability question flagged at the pre-optimization gate, now answered negatively. The optimized config posts a respectable point estimate (Sharpe 1.13, PF 1.58) but the decisive gates reject it: deflated_sharpe 0.0142 (vs 0.95 bar) with the optimized Sharpe 1.13 far below the expected-max luck bar 3.35 over 225 trials (is_significant=false, Sharpe CI [-1.35,+2.83] straddles 0, PBO 0.5966); the HOLDOUT FAILED with a NEGATIVE Sharpe -1.95 (ratio -3.875) — the recent once-tested window loses money; walk-forward is_overfitted=true with avg IS 3.33 collapsing to avg OOS 0.50 and wildly unstable OOS windows [-6.78, +6.70, +1.60]; and sensitivity FAILED with 3 cliffs on the core signal params (near_pct, min_streak, entry_threshold). The decay is confirmed: the optimized config goes 2026 -2.66% and base rolling Sharpe was negative through 2025/2026 — the Heiken-Ashi reversal edge concentrated in 2021-2022 and has stopped working recently. Not iterate (attempt 1 of 2): no robust region exists when the three core signal params are cliffs, the holdout is negative, DSR is 0.0142, and OOS swings from -6.8 to +6.7 — a second sweep re-selects another sub-luck-bar artifact. Not revise_hypothesis: this is overfitting + recent decay on a single major, not a proven mechanism stranded on a dead target, and HA color-flip reversal has no promoted sibling to redirect. FAILURE PATTERN: single-asset Heiken-Ashi color-flip reversal long-short on a crypto major produces a 2021-2022-concentrated edge that, after best-of-225 selection, fails deflated Sharpe (0.0142, below the 3.35 luck bar), fails the holdout with a negative Sharpe (-1.95), and is_overfitted=true with core-param cliffs — the HA-smoothed reversal signal is fitted to historical regimes and does not generalize out-of-sample, the same DSR-fail + negative-holdout signature as the other single-major reversal/momentum strategies this run.

Implementation

Single-asset Heiken Ashi color-flip reversal on BTCUSDT.BINANCE USD-M futures, daily bars, long+short. Builds Heiken Ashi candles recursively (HA_close = OHLC/4; HA_open = avg of prior HA_open/HA_close) to smooth intra-bar noise, then trades color-flip reversals: goes LONG when 3+ consecutive RED HA bars flip GREEN while price sits at/near the 20-bar low, and SHORT when 3+ consecutive GREEN HA bars flip RED at/near the 20-bar high. Exits on an against-position HA color flip, a +12% take-profit, a -6% stop-loss, or a 20-bar max hold. Positions are sized at 20% of account equity (capital-relative via get_account_equity()). calculate_signal returns a continuous reversal score every bar — large +/- on a confirmed flip (graded by streak length and proximity to the extreme), small bounded trend-continuation otherwise — thresholded at +/-1.0 in should_enter.

Backtest Review

Positive net-of-fee edge: profit_factor 1.51, Sharpe 0.95, Sortino 1.54, expectancy +$179/trade (~0.9% on a ~$20k position, well above the 0.15% futures fee bar)

Backtest Review

Edge spread across multiple regimes (2021 +12.2%, 2022 +6.8%, 2024 +2.4%, 2026 +4.1%) — not a single-bull-market artifact

Backtest Review

Trades as hypothesized: 108 color-flip reversal entries, both directions (31 long / 77 short), clean entry gate

Backtest Review

Low risk and favorable shape: max_drawdown 6.96%, Calmar 3.04, positive skew +4.26 (winners are the fat tail)

Backtest Review

Healthy sample (108 trades) for sensitivity/walk-forward; capacity $142M, fees not dominating (4.17% of gross)

Backtest Review

Low capital utilization (exposure 19.3%) — much of the book is idle; a position-size question for optimization

Backtest Review

tail_ratio 0.47 and max_consecutive_losses 9 — left-tail/streak risk to monitor, partly offset by positive skew

Backtest Review

Recent rolling Sharpe softened through 2025/early-2026, with the 2026-06-19 +4.17% day doing heavy recent lifting — regime durability is the key post-optimization question for walk-forward/holdout

Backtest Review

Modest absolute return (CAGR 2.8%) at current low exposure — the per-trade edge needs the optimizer to confirm it scales

Analysis

Base backtest was genuinely promising and correctly implemented (both-directions, 108 trades, PF 1.51, low drawdown) — which is why it earned the optimization spend

Analysis

Optimized point estimate is not terrible in isolation (Sharpe 1.13, PF 1.58, positive skew 3.33, low impact 2.23%) — but it does not survive deflation or forward testing

Analysis

Deflated Sharpe 0.0142 (vs 0.95 bar): the optimized Sharpe 1.13 is far below the expected-max luck bar 3.35 over 225 trials — indistinguishable from best-of-N selection noise; is_significant=false, Sharpe CI [-1.35, +2.83] straddles 0, PBO 0.5966

Analysis

Holdout FAILED with a NEGATIVE Sharpe -1.95 (ratio -3.875): the recent once-tested forward window loses money

Analysis

Walk-forward is_overfitted=true: avg IS 3.33 collapses to avg OOS 0.50 with wildly unstable OOS windows [-6.78, +6.70, +1.60]

Analysis

Sensitivity FAILED with 3 cliffs on the CORE signal parameters (near_pct, min_streak, entry_threshold) — the signal is fitted, not robust

Analysis

Recent decay confirmed: optimized config goes 2026 -2.66%, base rolling Sharpe negative through 2025/early-2026 — the reversal edge concentrated in 2021-2022 and has stopped working

Outcome Summary

This strategy faded trends on BTC daily using Heiken Ashi color flips — entering after 3+ opposite-color HA bars reversed near a 20-bar extreme — and earned an 'optimize' verdict on a genuinely attractive base run (108 two-sided trades, Sharpe 0.95, PF 1.51, 6.96% drawdown, multi-year edge), though flagged for recent rolling-Sharpe softness. Optimization answered the durability question negatively: deflated Sharpe 0.0142, a holdout that lost money (-1.95 Sharpe), walk-forward overfitted with OOS swinging from -6.8 to +6.7, and three cliffs on the core signal parameters. The analyst abandoned it at the analyzing stage on the first iteration, concluding the HA-smoothed reversal edge was concentrated in 2021-2022 and has stopped working — a fitted, non-generalizing signal with no robust region and no promoted sibling to redirect to — so it stopped before risk review.

Outcome Summary

A promising, low-drawdown base backtest (Sharpe 0.95, PF 1.51) can still be a regime-concentrated artifact — an HA color-flip reversal edge concentrated in 2021-2022 and decaying since fails deflated Sharpe and a negative-Sharpe holdout after best-of-N selection, with core-parameter cliffs proving the signal was fitted, not robust.

Outcome Summary

It cleared the backtest-review gate with an 'optimize' verdict, but the post-optimization analyst abandoned it: deflated Sharpe 0.0142 (<0.95) with the optimized Sharpe far below the 3.35 expected-max over 225 trials, is_significant false, a CI straddling zero, PBO 0.60, a holdout that FAILED with a negative Sharpe (-1.95), walk-forward overfitted (avg IS 3.33 → OOS 0.50, wildly unstable windows [-6.78, +6.70, +1.60]), and sensitivity failing with 3 cliffs on the core signal parameters.

Outcome Summary

A single-asset long-and-short reversal strategy on BTCUSDT daily Binance futures (1.0x leverage) using Heiken Ashi transformed candles (Valcu 2004) — going long when 3+ consecutive RED HA bars flip GREEN near a 20-bar low, short on the mirror flip near a 20-bar high — on the thesis that the HA smoothing produces cleaner, fewer-false reversal signals than raw candles.

Outcome Summary

The base backtest was genuinely promising — 108 trades (31 long, 77 short), +17.3% total, Sharpe 0.95, profit factor 1.51, expectancy +$179/trade, just a 6.96% max drawdown, Calmar 3.04 and positive skew 4.26, with the edge spread across multiple years — but it was concentrated in 2021-2022 and decayed recently, and the optimized config (Sharpe 1.13, PF 1.58) failed forward testing.
Strategy report

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