Skip to content
All strategies

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

Distilled from the '日内交易策略' section of 善's FMZ digest 'Six simple strategies for beginners' (https://www.fmz.com/digest-topic/4050, the My-language dual-MA script, fmz.com/strategy/129079). Following lesson L167 it is restated from first principles, not ported. It keeps the economic core: take a position only when a bar that EXPANDS in the trend direction appears inside an established trend. That bar closes beyond the previous close, makes a new high or low beyond the previous bar, and has a body in the trend……Show moreShow less

Distilled from the '日内交易策略' section of 善's FMZ digest 'Six simple strategies for beginners' (https://www.fmz.com/digest-topic/4050, the My-language dual-MA script, fmz.com/strategy/129079). Following lesson L167 it is restated from first principles, not ported. It keeps the economic core: take a position only when a bar that EXPANDS in the trend direction appears inside an established trend. That bar closes beyond the previous close, makes a new high or low beyond the previous bar, and has a body in the trend direction. The source's intraday cadence and pyramiding (BK add-on) are dropped because the 0.10% round trip kills them. It runs on 4H bars. The other five sections were screened and rejected. HODL/DCA has no timing edge to test. Bollinger scalping on 1-5m is the dead sub-fee microstructure class. RSI 30/70 is generic mean reversion, 0 survivors in 203 runs. 'Avoid pump groups' is advice, not a rule. The swing MACD+MA script was pre-tested with 0.12% RT cost: LTC COIN-M 4H lost in every cell (PF 0.68-0.87). BNB and DOGE 12H 'worked' only through the 2021 mania year and lost in most other years. BTC OKX 4H came out at PF 1.16-1.28 with a weaker year profile than this rule. Venue choice: OKX is 0.1% of the corpus against a >=5% quota, and OKX history in the catalog only runs to multiple years for BTCUSDT.OKX and ETHUSDT.OKX. The ETH OKX slot is already taken (EthVolumeConfirmedMomentumLS_OKX), so BTC is the only OKX instrument with enough history (14,848 4H bars since 2019-12-16). BTC is above the concentration share, and this rationale is why it is used anyway. Pre-study, point-in-time, next-bar-open fills, 0.12% RT cost, full notional, 2019-12 to 2026-09. At P1=50/P2=20/SL=3%: 274 trades (~41/yr), mean net +1.03%/trade, PF 1.46, win rate 22%, trade-level annualized Sharpe ~0.63, and yearly sums +0.99/+1.15/+0.28/+0.48/-0.15/-0.21/+0.28 for 2020-2026 (5 of 7 years positive). Robustness: every cell in a 12-cell neighbourhood (P1 40-80, P2 10-30, SL 3-4%) had PF 1.19-1.68 and trade Sharpe 0.33-0.67. That is a plateau, not a spike. The best cells (P1 60-80) were NOT chosen. Disclosed selection choices: venue (OKX, quota), instrument (only OKX name with history not already in the pipeline), timeframe 4H (source was intraday; the fee floor forced it up), and P1=50/P2=20 as the middle of the plateau. This is plain trend following, and the honest pre-study Sharpe is ~0.6, below lesson L166's 1.0 comfort bar. It is proposed at low priority as the most viable mechanism in the source, with modest pre-registered numbers. Risk profile: 50% of equity notional per position (leverage 0.5x effective, 1x max), so a 3% stop costs ~1.5% of equity. There is no pyramiding and at most one position.

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.

premise_falsified: the BTC OKX 4H trend-bar continuation was tested on a reliable 354-trade, 6.3-year sample and produced PF 1.049 against the pre-registered 1.46. That is below the 1.05 viability floor. Win rate is 0.29 (L142 payoff shape) and only 2 of 7 calendar years are positive (2021, 2022, 2024, 2025 and 2026 all lose). CAGR is 4.1%, information ratio vs buy-and-hold is -0.71, and max drawdown is 47.8% with an 1849-day drawdown duration. The PnL-weighted per-trade edge is about 0.13% of notional, roughly……Show moreShow less

premise_falsified: the BTC OKX 4H trend-bar continuation was tested on a reliable 354-trade, 6.3-year sample and produced PF 1.049 against the pre-registered 1.46. That is below the 1.05 viability floor. Win rate is 0.29 (L142 payoff shape) and only 2 of 7 calendar years are positive (2021, 2022, 2024, 2025 and 2026 all lose). CAGR is 4.1%, information ratio vs buy-and-hold is -0.71, and max drawdown is 47.8% with an 1849-day drawdown duration. The PnL-weighted per-trade edge is about 0.13% of notional, roughly the round-trip cost, and impact eats 27% of gross. Optimization cannot turn this into an edge; the pre-study's 12-cell plateau of PF 1.19-1.68 did not reproduce in the engine. QA's weak-edge concern is borne out. QA's funding concern is not: funding is credited in this run. First-report failure code: no_edge. Separate note for engine review: the daily MTM series has recurring paired -25..-38% / +30..+66% days in the middle of positions. These persist after the bracket was removed and make Sharpe, vol and DD unmeasurable. The cause is not verified, and it does not change this verdict, which rests on the reconciled closed-trade ledger.

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.