Strategies
BTC OKX 4H Trend-Bar Continuation: Typical-Price SMA/EMA Trend Filter + Directional Expansion-Bar Trigger, Long-Short, Fixed % Stop, Reverse-on-Opposite-Signal (BTCUSDT.OKX 4H, pure OHLCV)
Outcome: Abandoned
BtcOkxTrendBarContinuation
Outcome Summary
BtcOkxTrendBarContinuation restated an FMZ beginner's dual-MA intraday script as a 4H BTC OKX trend-bar continuation strategy, pre-registered at PF 1.46 and +1.03% per trade. Over three iterations the developer removed the same-bar flip and then the bracket-order path to fix an incoherent MTM curve, but the paired daily spikes persisted. The final backtest returned +28.96% over 354 trades with PF 1.049, only 2 of 7 positive years, a 47.8% drawdown and a per-trade PnL-weighted edge near cost. The analyst abandoned it at backtest review, before optimization, as a falsified premise with no edge, and optimization, analyst, and risk stages were never reached.
Hypothesis
Iteration 3 fixes the gate's metrics-incoherence flag (MTM Sharpe +0.84 vs equity-curve return -4.00%). Diagnosis from the stored report: the OKX 4H price data is clean, but the daily MTM series has 127 days with |return| > 20%, as paired spikes in the middle of held positions (e.g. 2025-08-17 -48% then 2025-08-18 +95% during a 0.56 BTC short). annualized_volatility 199% is impossible for a 0.5x BTC book. Across the last 10 days of experiments, 10 of 12 runs that use venue bracket orders show |daily| > 40% spikes, against 9 of 61 without brackets. So the single change is to remove the bracket (use_bracket_orders=false, take_profit_pct dropped because the hypothesis has no TP) and enforce the 3% stop in should_exit on the 4H close. The signal, trigger, reversal logic, sizing and imports are unchanged. Honest note: the equity curve of iteration 2 (-4%, PF 0.99, 431 trades, DD 48%) already suggests little edge, well below the pre-study's PF 1.46. This run's coherent metrics should decide whether the mechanism survives.
Implementation
BTCUSDT.OKX 4H long/short trend-bar continuation. The trend filter is EMA(20) vs SMA(50) of typical price, and the signal is their % spread, returned every bar. It enters on an expansion bar in the trend direction (close beyond the previous close, new high/low beyond the previous bar, body in the trend direction). Exits: a fixed 3% stop checked on the bar close, or an opposite signal, which closes the position and arms a one-bar pending reversal. Sizing is 50% of equity notional at 1x. There is no take-profit and no pyramiding.
Verification Results
Leave as is for this measurement. If the harness bracket/MTM artifact is fixed later, restore a venue-side stop so the stated risk holds intra-bar.
The hypothesis states a fixed 3% stop. It is enforced only on the 4H bar close in should_exit(), so gap or wide bars can overshoot it (the largest loss is $7.9k, ~7.6% of $104k initial equity, versus the intended ~1.5% of equity at 0.5x). The developer removed the bracket deliberately because of the MTM spike artifact. That trade-off is documented and allowed under check 17 (warning only).
Have the analyst estimate the funding drag from the stored OKX funding series (exchange okx, CDN from 2022-01-17) over the held intervals.
The OKX funding feed is not folded into the backtest PnL (funding_folded=false, 0 events). The book is in the market ~95% of the time, long and short, so reported returns leave out funding carry. The signal does not read funding, so this is not a look-ahead or feed-coverage defect, only a realism gap for the analyst.
Optionally stamp the bar ts when arming and expire the pending reversal after one bar by timestamp.
The pending reversal (_pending_side) is armed on the exit bar and consumed on the next flat bar. In live trading, if the exit order is still in flight on the next bar, the base template returns early, so the pending side persists to a later bar rather than living exactly one bar. In the backtest, market exits fill in-event, so this does not affect results.
None required.
min_bars_required() overrides the base method (static-analysis base_shadow). The override is intentional and correct: max(50, 5*20)+2 = 102 bars, which is well under the 500-bar buffer.
The smoke test is weak and matches the developer's own doubts. Sharpe is 0.32 (CI -0.43 to 1.10) and PF is 1.11, below the pre-registered PF of 1.46. Max DD is 40.7% and the max DD duration is 1095 days. The stressed-vol tercile loses 19.6%. Most of the return comes from a few large winners: the largest win is $46k against a mean of $179 per trade, and the win rate is 28.5%. OKX funding is NOT folded in (funding_folded=false, funding_events_available=0). For a long/short book that is exposed 95% of the time with ~6-day holds, the real carry drag or credit is missing from the PnL. Check the per-year breakdown and the funding drag first, before optimizing. The ledger reconciles roughly: 0.573% x 354 trades ≈ 203% gross on a ~0.52 notional/equity book, against +63% total return, well within the 20x tolerance.
Backtest Review
- Sharpe
- 0.79
- Total return
- 28.96%
- Max drawdown
- 47.77%
- Trades
- 354
- Win rate
- 29.1%
- Profit factor
- 1.05
Mechanism is implemented as hypothesized: 178 long / 176 short, entries are trend-direction expansion bars, one position at a time, sized at ~0.5x equity; 354 trades is an adequate sample.
Ledger reconciles: 354 x $81.67 avg PnL = +$28.9k, which matches total_return +28.96%. Funding is folded in (6498 events), so QA's funding-omission concern no longer applies.
Profit factor is 1.049. That is below the 1.05 review viability floor and far below the pre-registered PF of 1.46. Win rate 0.29 with PF < 1.2 is the falsified trend-payoff shape (L142).
Only 2 of 7 calendar years are positive: 2020 +43%, 2021 -26%, 2022 -5%, 2023 +33%, 2024 -3%, 2025 -12%, 2026 YTD -27%. The pre-study claimed 5 of 7 positive.
Pre-registered bar vs actual: the pre-study claimed +1.03% net per trade; the backtest gives 0.57% per trade (mean of % returns). The PnL-weighted edge is only about 0.13% of notional per trade: $81.67 on a ~$62k average position, which is at the ~0.10% round-trip cost. Modelled impact takes 26.7% of gross.
Buy-and-hold comparison (L170): information ratio is -0.71. CAGR is 4.1% over 6.3 years, while BTC buy-and-hold rose several-fold over the same window. Max drawdown is 47.8% (CI 70-99%), the drawdown lasted 1849 days, and the book is 95% time-in-market.
Daily MTM series artifact (mechanism not verified): from late 2021 onward there is a paired day of about -25% to -38% followed by +30% to +66% roughly every 3-6 weeks, e.g. 2025-08-17/18 at -38.7/+64.4 and 2026-01-30/31 at -37.1/+66.0. This inflates annualized vol to 172% and CVaR to 19%, so Sharpe 0.79, DD and tail metrics are not trustworthy. The spikes persist after the iteration-3 bracket removal, so they are not caused by the bracket order path. Flag for engine review of OKX 4H MTM marking.
PnL-weighted ~0.13%, at cost
Analysis
Backtest gate: - metrics unreliable: Incoherent: Sharpe 0.84 disagrees in sign with total_return -4.00% — the Sharpe is computed from the mtm_equity_curve series while the return comes from the equity curve. Judge on the equity curve.
Outcome Summary
A pre-study plateau (PF 1.19-1.68, 5 of 7 positive years) did not reproduce in the engine, so a low-Sharpe (~0.6) plain trend rule with a 22-29% win rate should be treated as fee-marginal from the start. Recurring paired -25..-38%/+30..+66% daily MTM spikes on OKX 4H should also get an engine review, because they make Sharpe, volatility and drawdown unreliable.
The analyst's backtest review, after 3 iterations, abandoned it as premise_falsified/no_edge before optimization: PF 1.049 fell below the 1.05 viability floor and far short of the pre-registered 1.46. It also had an information ratio of -0.71 versus buy-and-hold, and impact consumed 27% of gross.
A long/short BTCUSDT.OKX 4H trend-following rule: enter only when a bar that expands in the trend direction appears inside a trend defined by an EMA(20) vs SMA(50) of typical price, with a fixed 3% close-checked stop and reverse-on-opposite-signal, sized at 50% of equity.
Over 6.3 years (2019-12 to 2026-04) it made 354 trades with a +28.96% total return (CAGR 4.1%), MTM Sharpe 0.79, profit factor 1.049, win rate 0.29, and a 47.8% max drawdown lasting 1849 days. Average trade return was 0.57% of notional, but the PnL-weighted edge was only ~0.13%, roughly the round-trip cost, and only 2 of 7 calendar years were positive.
Backtest and paper results are hypothetical. Trading involves risk of loss.