Skip to content

View original

AptTrendPullbackEntryLS

Hypotheses

APT Trend-Pullback Entry, Long-Short (APTUSDT.BINANCE USD-M — Daily Trend Sets Direction, 4H Pullback-to-Short-EMA Sets a CHEAP Entry, ATR-Trailing Exit; the Edge Is Entry TIMING Not a Regime Gate, 3-Parameter)

Hypotheses

A LONG-SHORT, single-instrument, pure-OHLCV trend-follower on APTUSDT.BINANCE USD-M perpetual that is mechanically DISTINCT from the factory's two promoted trend recipes. Both winners (Dual-Timeframe Momentum Confluence and Volume-Confirmed Momentum) enter WITH momentum — they buy strength/breakouts, so entry price is at the top of the impulse and per-trade capture is thin, which is exactly why the momentum family fills the fee graveyard. This strategy inverts the ENTRY while keeping trend DIRECTION: the daily (1D) EMA slope defines the regime (up/down/flat), and instead of chasing, we WAIT for a 4H pullback that pulls price back to (or just through) a short 4H EMA — a temporary counter-trend dip — then enter in the direction of the daily trend on the first 4H close that turns back up (long) or down (short). Buying the dip inside an uptrend (and shorting the rip inside a downtrend) buys a structurally CHEAPER entry, which enlarges the realized per-trade capture and is the direct antidote to sub-fee economics. Instrument choice is deliberate data-estate spending: APT is a deeply liquid Binance USD-M perp (hundreds of $M daily) with ~3 years of history at 4H yet almost no presence in the corpus, unlike the over-mined BTC/ETH/SOL/ADA/AVAX/BNB/XRP/LINK/DOGE set. Only 3 parameters (daily EMA length, 4H entry EMA length, ATR trail multiple) to resist overfitting.

Hypotheses

Implements the hypothesis exactly: daily EMA slope sets DIRECTION, a 4H pullback to a short EMA sets a CHEAP entry, ATR trail exits, three core knobs (daily_ema_len, entry_ema_len, trail_atr) plus the regime/exit deadbands. Direction and entry are deliberately separated -- the daily leg is a slower-timeframe CONTEXT leg (1-DAY vs 4-HOUR) so the base class's same-timeframe alignment barrier never defers the 4H signal, and the point-in-time daily read is whatever daily bar has already CLOSED. Both legs use O(1) incremental state (EMA, Wilder ATR, bounded deques), so the 300s Layer-3 budget is safe. Entry frequency was estimated on the real APT 4H+1D catalog history before submitting: ~20 trades/yr (~80 over the 3.9-year history) with the shipped defaults, and >=13/yr across the whole declared parameter box -- no zero-trade or single-digit-sample risk. Venue: BINANCE USD-M because the strategy shorts; leverage stays 1.0 because ATR-risk sizing (2% of equity against a ~4.5-ATR stop) never needs more than ~0.2-0.7x equity notional, so declaring leverage>1 would be inert. One honest caveat for the Research Lead/Analyst: replaying this exact logic over APT's full 4H history, per-trade expectancy net of the 0.10% round trip is around zero-to-slightly-negative at trade counts of 20-50/yr (positive only in the wide-trail corner where trades drop to ~5/yr), so the cheap-entry premise may not clear fees on this symbol -- I implemented it as specified and leave that call to the backtest.

Hypotheses

Negative expectancy on a decisive 83-trade / 1418-day sample: profit_factor 0.638 (<1, gross-negative before costs), avg_trade_return_pct -1.28% (below ZERO, not merely below the 0.15% Binance USD-M fee floor), total_return -25.9%, expectancy -$346.7/trade, Sharpe -0.668 with CI [-1.683, 0.291] straddling zero. Commission is only 2.11% of gross, so this is a gross-negative signal, not fee-fragility — optimization cannot lift an edge that is negative before costs. The cheap-entry pullback mechanism is faithfully implemented (83 signaled = 83 submitted, balanced long/short, ATR trailing exit) so this is a fair test, and the premise is not supported: the book loses in the calm (-22.5%, Sharpe -1.98) and stressed (-7.4%) regimes and in 3 of 4 calendar years, the opposite of a robust trend-follower. QA's concern is borne out on full history. A PF-0.638 signal is not worth 2 hours of walk-forward curve-fitting. abandon_class=negative_expectancy.

Implementation

Long-short 4H trend-follower on APTUSDT.BINANCE USD-M perp whose edge is ENTRY TIMING, not a regime filter. An extra 1-DAY leg (on_extra_bar) maintains a daily EMA whose vol-normalized slope z-score defines the regime with a deadband (up / down / flat). On the 4H primary leg the strategy never chases the impulse: it ARMS when price pulls back and touches/pierces a short 4H EMA against the daily trend (dip in an uptrend, rip in a downtrend), then enters WITH the daily trend on the first 4H close that turns back up (BUY) or down (SELL), provided the arm is at most arm_window bars old. The per-bar signal is continuous: trend_z * 1/(1+max(0, in-trend extension in ATR units)) -- trend conviction discounted by how expensive the entry is, so it varies every bar and is largest exactly when price sits at/below the short EMA inside a trend. Exits are an ATR trailing stop (trail_atr x 4H ATR from the best close since entry, which doubles as the initial stop) or a deadband-confirmed flip of the daily regime. Sizing risks risk_pct of equity against the ATR trail distance, capped at max_notional_frac x leverage x equity of notional; no leverage is used (leverage=1.0).

Verification Results

Optionally require self._armed_age >= 1 before allowing entry so the turn-up confirmation is on a bar strictly after the touch bar.

Verification Results

The arm-and-fire can complete on the SAME 4H bar: _update_arm sets self._armed=1 when the bar's low touches/pierces the EMA, and should_enter then immediately fires if that same bar also closed up (turn_up). The hypothesis phrases entry as the 'first 4H close that turns back up' after the pullback, which could be read as a subsequent bar. This is a mild sequencing ambiguity, not a bug — a bar that both dipped to the EMA and closed up genuinely satisfies 'pullback then turn', and it does not create look-ahead. Left as informational; if strict next-bar sequencing is desired, gate entry on armed_age >= 1.

Verification Results

Sandbox smoke test is decisively negative (total_return -25.9%, profit_factor 0.67, win_rate 0.29, avg_trade_return_pct -1.28% over 83 trades) and the developer's own honest note says per-trade expectancy net of the 0.10% round trip is around zero-to-slightly-negative on APT at 20-50 trades/yr, positive only in the wide-trail corner where trades collapse to ~5/yr. The cheap-entry premise (pullback-to-EMA instead of chasing the impulse) is faithfully implemented, but on this symbol it may not clear fees. Regime cells show the edge is absent in the calm tercile (-22.5%, Sharpe -1.98) and only marginally positive in normal vol (+2.4%), consistent with a mechanism that is not robust across regimes. Recommend the analyst weigh whether the wide-trail low-frequency corner is the only viable region before committing to a full optimization run.

Backtest Review

Faithful implementation of the cheap-entry premise: 83 signals = 83 submitted, balanced long/short (44 long / 39 short), pullback-to-EMA state machine + ATR trailing exit as described.

Backtest Review

Decisive sample: 83 trades over 1418 days / ~3 years of 4H APT history, metrics_reliable=true.

Backtest Review

Negative expectancy on a reliable sample: profit_factor 0.638 (<1, gross-negative BEFORE costs), avg_trade_return_pct -1.28% (below ZERO, not merely below the 0.15% Binance USD-M fee floor), total_return -25.9%, expectancy -$346.7/trade.

Backtest Review

Commission is only 2.11% of gross PnL, so this is a gross-negative signal, not fee-fragility — no parameter tuning can lift an edge that is negative before costs.

Backtest Review

Sharpe -0.67 with CI [-1.683, 0.291] straddling zero, Sortino -0.89, recovery_factor -0.77, CAGR -8.9%, max_drawdown 37.8%, 13 consecutive losses.

Backtest Review

Loses in the calm (-22.5%, Sharpe -1.98) and stressed (-7.4%) regimes and only marginally positive in normal vol (+2.4%) — not robust across regimes; loses in 3 of 4 calendar years (2023/2024/2025).

Backtest Review

Single-name OHLCV trend clone far below the only tier this class has ever survived (PF>=2.0, Sharpe>=1.5, DD<20%); QA's edge concern borne out on full history.

Outcome Summary

AptTrendPullbackEntryLS-794c4483f1

Outcome Summary

AptTrendPullbackEntryLS aimed to beat the fee graveyard that traps momentum recipes by inverting entry timing: keep the daily trend as direction but wait for a 4H pullback to a short EMA to buy in cheaper, exiting on an ATR trailing stop. The mechanism was faithfully implemented (83 signals, all submitted, balanced long/short) and tested decisively over ~3 years, but it lost 25.9% with a 0.638 profit factor and a -1.28% average per-trade return — negative before costs, not merely below the fee floor. Because commission was only 2.11% of gross PnL, the analyst judged this a gross-negative signal that optimization could not lift and abandoned it at the pre-optimization backtest-review gate. Later stages (optimization, analysis, risk review, promotion) were never reached.

Outcome Summary

A 'cheaper entry' mechanism does not create edge if the underlying trend signal is negative before fees — verify the raw signal is gross-positive before attributing failure to trading costs or overfitting.

Outcome Summary

The backtest-review gate returned an 'abandon' verdict before optimization: the signal was gross-negative before costs (commission only 2.11% of gross PnL), so no parameter tuning could rescue it, and it lost in the calm (-22.5%) and stressed (-7.4%) regimes and in 3 of 4 calendar years.

Outcome Summary

A long-short, single-instrument OHLCV trend-follower on APTUSDT.BINANCE USD-M perp that used the daily EMA slope to set direction and waited for a 4H pullback to a short EMA to buy a structurally cheaper entry (dip-buy in uptrends, rip-sell in downtrends) with an ATR trailing exit.

Outcome Summary

Over a decisive 83-trade, 1418-day (~3-year) 4H backtest it lost money: total return -25.9%, profit factor 0.638, avg_trade_return_pct -1.28% (below zero), Sharpe -0.668 (CI [-1.683, 0.291]), max drawdown 37.8%, win rate 27.7% with balanced 44 long / 39 short trades.
Strategy report

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