Skip to content

View original

AdaTakerFlowExhaustionDivergenceLS

Hypotheses

ADA Perp Order-Flow Exhaustion Divergence, Long-Short (Single-Instrument ADAUSDT.BINANCE USD-M — Fade Price Extremes That Are NOT Confirmed by Aggressive TAKER Flow: Short a Higher-High Made on Weakening Taker-BUY Pressure, Long a Lower-Low on Weakening Taker-SELL Pressure, Defined-Risk, 3-Parameter)

Hypotheses

A LONG-SHORT, SINGLE-INSTRUMENT, SINGLE-VENUE reversal strategy on the ADAUSDT.BINANCE USD-M perpetual that adds ONE genuinely new, orthogonal information source — aggressive TAKER order-flow (taker-buy vs taker-sell volume) — to a price signal, exactly the augmentation L38 permits (new information source, not a momentum clone or symbol swap). The mechanism is order-flow EXHAUSTION DIVERGENCE: a price extreme is only trustworthy if aggressive market-order flow is pushing in the same direction. When price grinds to a new local HIGH but the net taker-BUY pressure behind it is FALLING (the rally is running on passive drift / thinning aggression), the move is exhausted and prone to reverse → SHORT; mirror for a new local LOW made on WEAKENING taker-SELL pressure → LONG. This is distinct from every idea in my pending set: it is not momentum (ETH price-OI), not funding-contrarian (DOGE), not a failed-breakout structure (XRP), and not options (BTC calendar); it reads WHO is aggressive, not just where price went. It deliberately follows the only archetype that has survived this factory — single-instrument, single-venue, long-short, defined-risk, trailing-managed, low-parameter — and stays LOW-FREQUENCY on 4h bars with multi-percent targets so the ~0.10% USD-M round trip is immaterial (avoids the fee_edge graveyard). A HARD structural stop at the divergence extreme plus a 2x leverage cap make the liquidation/-100% blow-up that killed the prior single-instrument MR strategy impossible by construction. ADA is a liquid, retail-heavy, non-BTC/ETH/SOL/XRP/DOGE symbol (diversifying my instruments) whose order flow carries strong, exploitable exhaustion signatures. 3 parameters, to resist the overfit deaths that dominate the log.

Hypotheses

This iteration addresses ONLY the two coupled risk defects the Layer-4 QA review identified, leaving the signal path (which passed Layers 1-3) byte-identical. Defect 1, close-based stop: should_exit could only compare pnl against the stop at the NEXT 4H close, so a bar that traded violently through the level exited far past it. Fixed by overriding _submit_entry to emit an OCO bracket via self.order_factory.bracket(...) -- a resting stop_market child that fills INTRABAR at the stop price, plus a limit TP at tp_r x R. This is the exact remedy already validated on the AVAX failed-breakout sibling the reviewer cited, using the same API and the same _submit_exit override (cancel resting children, then close) for the backstop path. I kept the base class's warmup and market-ready guards inside the override so live/paper behaviour is unchanged. Defect 2, leverage amplifying the overshoot: the reviewer showed min_stop_pct=0.8% with risk_frac=0.02 demanded 2.5x notional and therefore pinned tight-stop trades at the 2x leverage ceiling (avg_position_pct 120.8%), turning an 18% overshoot into a 37%-of-equity loss. Fixed by removing the leverage multiply from position_size entirely, replacing it with an absolute max_notional_frac=0.50 cap, halving risk_frac to 0.01, and raising min_stop_pct from 0.8% to 1.5% so the cap is no longer routinely saturated. Because leverage is no longer referenced in sizing, config leverage is set to 1.0 as the rules require (no leverage_set_but_unused); the futures venue is still correct because the strategy shorts. Worst case per trade is now ~1% of equity at the resting stop plus fill slippage, and gross exposure never exceeds half of equity, so the 49.6% drawdown / -37k single-loss path is closed by construction rather than by assertion. Two honest notes for the reviewer. First, a side effect of the bracket is that while the SL/TP children rest, the base class's orders_open guard skips _process_primary, so the trailing give-back, opposite-divergence and time-stop exits become backstops that fire only when no protective order is live; the bracket's fixed 1R stop / 2.5R target now governs the payoff. That is a real change to the exit profile and it should improve the reviewer's second finding (avg_win $3290 ~= avg_loss $3203 at a 45.8% win rate) by making the reward:reward ratio positive by construction, but it will lower the win rate, and I did not tune any threshold to chase that. Second, I agree with the reviewer's edge concern and am not disputing it: profit_factor 0.87 and avg_trade_return_pct ~0.003% say the fade mechanism did not revert profitably net of costs in this sample. I have fixed the risk defect as instructed and made no attempt to re-tune the signal to rescue the return; if the contained-tail backtest still shows no edge, this should be abandoned on the mechanism rather than iterated further.

Hypotheses

Decisive net loser that breaches the >50% drawdown hard-abandon line (L19). profit_factor 0.77 (<1.0), total_return -60.6%, Sharpe -0.18, avg_trade_return_pct -0.398% (negative), max_drawdown 61.6% (CI to 92.8%), expectancy -$116/trade across 512 trades — and it loses money in every single year 2022-2026 with rolling Sharpe negative for almost the entire history. Both legs fail (long_win_rate 25.6%, short_win_rate 24.0%), so the core premise — that a price extreme unconfirmed by aggressive taker flow reverses — is falsified: the exhaustion-divergence fade has no directional edge net of costs in either direction. This is not fee-fragility (avg_trade_return_pct is negative, not merely thin) and not a tuning problem — there is no parameter region to optimize toward when the edge is negative across every regime and the drawdown is 62%; best-of-225-trial optimization would only overfit the handful of good months. This is the alt mean-reversion fade family that has repeatedly died this session. Abandon per the PF<1.0 / negative-return / negative-avg_trade_return_pct / >50%-DD rules rather than spend 2 hours optimizing.

Implementation

Long-short order-flow exhaustion reversal on ADAUSDT.BINANCE USD-M 4H bars. The signal is unchanged from the version that passed Layers 1-3: a continuous divergence score price_pos - flow_pos, where price_pos is the close's position inside the trailing 30-bar high/low range rescaled to [-1,+1] and flow_pos is the same rescaling of the smoothed taker aggressor imbalance ((buy-sell)/(buy+sell)) inside its own 30-bar range. A large positive score means price is pressing the top of its range on draining taker-BUY aggression -> SHORT the exhausted rally; a large negative score means a new low made on faded taker-SELL pressure -> LONG. What changed in this iteration is the risk plumbing: entries are now submitted as an OCO bracket (market entry + a real resting stop_market protective stop at the structural divergence extreme + a limit take-profit at 2.5R), and sizing risks 1% of equity at the stop with a hard 50%-of-equity gross notional cap and no leverage multiply.

Verification Results

Verification failed (Layer 4 — QA review): - THE 'DEFINED-RISK, NO-BLOWUP BY CONSTRUCTION' CLAIM IS FALSIFIED BY THE SANDBOX. The hypothesis states a hard structural stop plus a 2x leverage cap make the liquidation/-100% blow-up 'impossible by construction,' but the sandbox prints total_return -30%, max_drawdown 49.6% (CI to 94.0%), and a single largest_loss of -$37,042 (~37% of a ~$100k account, ~18x the nominal 2% risk_per_trade budget), with avg_position_pct 120.8% (leveraged). Two coupled defects produce this, and they are the SAME risk-control failure already identified and fixed in the XRP failed-breakout sibling: (1) THE STOP IS CLOSE-BASED, NOT INTRABAR. should_exit computes pnl_pp = get_position_pnl_pct(position, self._last_close) and only fires on pnl_pp <= -stop_pp, so a 4-hour bar that trades violently through the stop level does not exit until the NEXT close, far past the intended stop. (2) 2x LEVERAGE AMPLIFIES THE OVERSHOOT. position_size caps notional at equity*leverage = 2x, and because min_stop_pct=0.8% drives equity*0.02/0.008 = 2.5x into that cap, tight-stop trades are routinely sized at the 2x ceiling. A 2x-notional position overshooting a close-based stop by ~18% (well within ADA's 4h crash range) = the observed 37%-of-equity loss. The nominal 2%-at-stop risk is therefore illusory for exactly the tail trades that drive the 49.6% drawdown. - Even setting the risk defect aside, the sandbox shows no edge: profit_factor 0.87, avg_trade_return_pct ~0.003% (essentially zero), total_return -30%, Sharpe 0.38 with CI [-1.29, 2.10] straddling zero, avg_win $3290 ~= avg_loss $3203 at a 45.8% win rate (slightly negative expectancy). The order-flow-divergence fade does not, in this sample, revert profitably net of costs. This is an edge question for the backtest reviewer, secondary to the risk defect, but it means that even with the tail contained the mechanism may still be a net loser and should be abandoned rather than re-tuned if so.

Verification Results

At backtest_review, evaluate on the full multi-year window; if win_rate stays below the ~1/(1+tp_r) breakeven and profit_factor < 1.0 with the tail now contained, ABANDON the taker-flow-divergence fade rather than optimizing (there is no parameter region to tune toward when the raw hit rate is below the geometry's breakeven). Only proceed if the full window shows the fade clearing its 2.5R target often enough to pay.

Verification Results

RISK FIXES VERIFIED, BUT THE SANDBOX SHOWS NO EDGE — a likely abandon at backtest_review. The two coupled risk defects I raised on iteration 2 are genuinely fixed and the metrics prove it: the largest single loss fell from -$37,042 (~37% of equity, ~18x the budget) to -$1,146 (~1.1%, i.e. ~the 1% risk_frac at the resting stop), max_drawdown fell 49.6% -> 22.7%, and avg_position_pct fell 120.8% -> 42.1% (under the 50% cap). The close-based stop is replaced by a real resting stop_market inside an OCO bracket (intrabar fill), and the leverage multiply is removed from sizing. Defined risk is now real. HOWEVER, with the tail contained the strategy is a net loser: total_return -15.5%, profit_factor 0.74, win_rate 0.247, Sharpe -0.71 (CI [-2.52, 1.03]), avg_trade_return_pct +0.114% (positive but BELOW the 0.15% USD-M futures floor). The bracket made reward:risk positive by construction (avg_win $2046 vs avg_loss $904, ~2.3:1) but the 24.7% win rate sits just below the ~28.6% breakeven for a 2.5R-target / 1R-stop geometry, so expectancy is -$175/trade — the order-flow-divergence fade does not hit its target often enough to pay. This is not a QA code-correctness defect (the code is now correct and the edge call belongs to the analyst on the full multi-year backtest); the developer explicitly agrees and asks for abandonment on the mechanism if the contained-tail backtest still shows no edge.

Backtest Review

Genuinely orthogonal information source (aggressive taker order-flow) added to price, not a momentum clone

Backtest Review

Sound defined-risk construction: real intrabar stop_market bracket, risk-based sizing, hard notional cap, no leverage multiply

Backtest Review

Sufficient sample (512 trades) and clean feed handling make the negative result reliable (metrics_reliable=true)

Backtest Review

profit_factor 0.77 (<1.0) and total_return -60.6% — a decisive net loser

Backtest Review

avg_trade_return_pct -0.398% — the average trade LOSES money as a % of notional

Backtest Review

max_drawdown 61.6% (CI to 92.8%) breaches the >50% hard-abandon line

Backtest Review

Negative in every single year 2022-2026; rolling Sharpe negative across almost the entire history

Backtest Review

Both legs fail (long_win_rate 25.6%, short_win_rate 24.0%) — the exhaustion-divergence fade has no directional edge

Backtest Review

win_rate 24.8% with kurtosis 41.5 — result depends on rare tail winners that never overcome the loss flood

Outcome Summary

This strategy tried to give the factory a new lens — reading who is aggressive rather than just where price went — by fading ADA price extremes that aggressive taker order-flow failed to confirm, following the factory's only surviving archetype of single-instrument, single-venue, long-short, defined-risk trades. By iteration 3 the developer had done the engineering well: a genuinely orthogonal flow signal, a real intrabar stop_market OCO bracket replacing the falsified close-based stop, risk-based sizing with a hard notional cap and no leverage multiply, all cleanly measured over 512 trades. But the edge simply was not there — profit factor 0.77, a -60.6% return, negative per-trade expectancy, a 61.6% drawdown, and both legs winning under 26% of the time in every year from 2022 to 2026. The analyst abandoned it at backtest review as a falsified, negative-expectancy member of the alt mean-reversion fade family that had repeatedly died this session, with no parameter region worth optimizing toward.

Outcome Summary

Adding a genuinely orthogonal information source (aggressive taker flow) and rebuilding the risk plumbing into a proper intrabar stop bracket does not create an edge — if both the long and short legs lose across every regime, the exhaustion-divergence premise itself is falsified and no parameter tuning can rescue a negative-expectancy fade.

Outcome Summary

It was abandoned at the BACKTEST_REVIEW gate on multiple hard-fail grounds: profit factor below 1.0, negative total return and negative per-trade return, and a max drawdown breaching the >50% hard-abandon line. Because both legs lose, the core premise — that a flow-unconfirmed price extreme reverses — is falsified with no directional edge net of costs, so it never reached optimization or analysis.

Outcome Summary

A long-short, single-instrument, single-venue reversal strategy on the ADAUSDT.BINANCE USD-M perp that adds aggressive taker order-flow as an orthogonal information source — fading price extremes not confirmed by aggressive flow (shorting a new local high made on weakening taker-buy pressure, longing a new local low on weakening taker-sell pressure) with a defined-risk intrabar stop bracket.

Outcome Summary

The backtest was a decisive net loser: profit factor 0.77, total return -60.6%, avg_trade_return_pct -0.398% (the average trade loses money), Sharpe -0.18, and expectancy -$116/trade across a large 512-trade sample. Max drawdown was 61.6% (CI to 92.8%), it lost money in every year 2022-2026, and both legs failed (long win rate 25.6%, short win rate 24.0%) with results dependent on rare tail winners (win rate 24.8%, kurtosis 41.5).

Iteration History

Verification failed (Layer 2 — synthetic scenarios): Parameters used: ['tp_r', 'lookback', 'risk_frac', 'atr_period', 'trail_arm_r', 'entry_thresh', 'min_notional', 'min_stop_pct', 'trail_give_r', 'stop_atr_mult', 'max_hold_hours', 'flow_max_stale_hours'] Check that __init__ sets all attributes from self.parameters.get(). - steady_uptrend: TypeError: AdaTakerFlowExhaustionDivergenceLS._rescale() takes 3 positional arguments but 4 were given (bar timestamp: 1735692480000) - steady_downtrend: TypeError: AdaTakerFlowExhaustionDivergenceLS._rescale() takes 3 positional arguments but 4 were given (bar timestamp: 1735692480000) - flat_ranging: TypeError: AdaTakerFlowExhaustionDivergenceLS._rescale() takes 3 positional arguments but 4 were given (bar timestamp: 1735692480000) - volatility_spike: TypeError: AdaTakerFlowExhaustionDivergenceLS._rescale() takes 3 positional arguments but 4 were given (bar timestamp: 1735692480000) - zero_volume: TypeError: AdaTakerFlowExhaustionDivergenceLS._rescale() takes 3 positional arguments but 4 were given (bar timestamp: 1735692480000) - price_gap: TypeError: AdaTakerFlowExhaustionDivergenceLS._rescale() takes 3 positional arguments but 4 were given (bar timestamp: 1735692480000)
Strategy report

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