Strategies
Thermostat (恒温器) Regime-Switching System, Faithful Port on LINK OKX Swap 1H: CMI<20 Chop Mode Trades KD Turns in the Extreme Zones, CMI>=20 Trend Mode Trades Bollinger(50,2) Close Breakouts, Always-Reversible Long/Short, Entry-Regime-Dependent 3%/1% Exits (LINKUSDT.OKX 1-HOUR)
Outcome: Abandoned
ThermostatCmiKdBollReversal
Outcome Summary
ThermostatCmiKdBollReversal ported the FMZ Thermostat system to LINKUSDT.OKX 1H, changing only the venue, sizing and fees. It switched between KD-turn mean reversion in choppy markets and Bollinger breakouts in trending ones, and could always reverse direction. The first backtest was close to a total loss: -98.3% over 1,560 trades, Sharpe -0.92, average trade -0.35% of notional. It lost in 7 of 8 stress windows and in all three volatility regimes. The analyst abandoned it at backtest review for negative gross expectancy, so optimization, the analyst stage after optimization and risk review were never reached.
Hypothesis
Non-BTC, under-represented venue (OKX 3.6% of experiments), long+short (long_short is 24% vs long_only 76%), no prior Thermostat/CMI hypothesis in the knowledge base. LINK OKX has 1h bars since 2020-03, giving ~6.5 years for walk-forward + holdout.
Implementation
Thermostat regime switch on LINKUSDT.OKX 1H, ported from the FMZ MyLanguage code. CMI = |C-C[cmi_period-1]| / (HHV(H,cmi_period) - LLV(L,cmi_period)) x 100. When CMI < 20 (chop), it buys/reverses long when K>D and D<30, and sells/reverses short when K<D and D>70. KD is 9/3/3 with the Chinese SMA(X,M,1) smoothing. When CMI >= 20 (trend), it buys/reverses long on a close above the 50-bar, 2-sample-std Bollinger top and sells/reverses short on a close below the bottom. New entries open only after BARPOS > N. Exits depend on the CMI of the opening bar. Chop-entered positions take profit at 3% beyond entry once KD turns against them (K<D for longs, K>D for shorts). Trend-entered positions take profit at 3% or stop at 1%, each only with the close on the wrong side of the 50-bar MA. Any opposite open signal reverses the position with a single market order. Each position is 60% of equity at 1x. Market orders fill at the signal bar's close, the 24/7-venue equivalent of a next-bar-open fill.
Implements BUYPK1/SELLPK1/BUYPK2/SELLPK2 and BUYY1/2, BUYS2, SELLY1/2, SELLS2 as in the source. REF(CMI,BARSBK/BARSSK) is the CMI value stored at the opening signal (scalar entry_cmi), compared against the tunable cmi_threshold. BKPRICE/SKPRICE is position.avg_px_open. The bar order matches the source: open/reverse signals first, then exits. A bar that closes a position does not reopen on the same bar. Risk route (b): signal exits plus 60%-of-equity capped sizing. Note: chop-mode entries in the source have no stop-loss; they exit only on the 3% take-profit with a KD turn, or on an opposite-signal reversal. This is ported as-is.
Verification Results
Optional: return a small value (e.g. 2) so the strategy's own BARPOS>N gate is the only warmup, matching the source exactly.
min_bars_required() returns max(boll_period, cmi_period, kd_period)+1 (51). The base template therefore does not call calculate_signal for the first 51 bars, so the strategy's own deques and the BARPOS counter start filling only after that. The first possible entry is about 100 bars into the data instead of about 50. This adds warmup but has no look-ahead and leaves the rules unchanged. The 130-bar evaluation warmup still covers it.
Set entry_cmi in on_position_opened/changed, or only after confirming that the order was submitted.
entry_cmi is overwritten before the order is confirmed. If _submit_entry drops the reversal (entry in flight, size 0 after the margin cap, or paused), the existing position keeps running with the new bar's CMI as its 'entry regime', which can change which exit set applies. A flat entry dropped for min notional has the same effect, but harmlessly. Simulated market orders fill in full, so this almost never happens in backtests.
Chop-mode positions have no stop. They exit only on a 3% favourable move with a KD turn, or on an opposite signal, so a chop-entered position caught by a trend that never prints an opposite band or KD signal can lose an open-ended amount at 60% of equity. Risk route (b) allows this, but the worst realised loss per trade should be checked at risk review. The source's own FMZ backtest was weak (Sharpe 0.04, most gains given back). An always-in-market reversal system on LINK 1h will pay many round trips, so check the full-history avg_trade_return_pct against the 0.10% floor first.
Backtest Review
- Sharpe
- -0.92
- Total return
- -98.31%
- Max drawdown
- 98.79%
- Trades
- 1560
- Win rate
- 33.8%
- Profit factor
- 0.75
The code follows the FMZ MyLanguage rules closely: CMI regime split, KD turns in the 30/70 zones in chop mode, Bollinger(50,2) close breakouts in trend mode, exits that depend on the regime at entry, and reversals in a single order.
The sample is large and reliable: 1,266 closed positions over about 5.3 years, balanced between longs (625) and shorts (641), as an always-reversible design should be.
Average trade is -0.41% of notional against the 0.15% OKX floor. That is negative even before the roughly 0.10% round-trip cost, so the losses are not just fees.
PF 0.75, win rate 34% with average win $676 vs average loss $472 (payoff 1.43, too low for that hit rate), Sharpe -1.03 (CI -1.89 to -0.18).
Total return -97.8% with a 98.5% max drawdown. Every calendar year lost money (2020 -64%, 2021 -54%, 2022 -35%, 2023 -39%, 2024 -48%, H1 2025 -35%), and the strategy lost in 7 of 8 stress windows.
Commissions were $14.5k, a small part of the loss: the gross signal itself loses money on LINK 1h.
Outcome Summary
On LINK 1H, a CMI-switched mix of KD mean reversion and Bollinger breakouts lost money gross of fees in every year and in all three volatility regimes, so a regime classifier alone did not give this system an edge.
The analyst rejected it at backtest review for negative expectancy, before optimization. The average trade was negative even before the ~0.10% round-trip cost, so the signal itself loses money gross of fees, and the tunable regime and band parameters were judged unable to fix losses this uniform across years and regimes.
A faithful port of the FMZ Thermostat regime-switching system on LINKUSDT.OKX 1-hour bars: when the Choppy Market Index (CMI) is below 20 it fades KD turns in the extreme zones, when CMI is 20 or above it follows close breakouts of a Bollinger(50,2) band, it is always reversible long/short at 60% of equity, and its 3%/1% exits depend on the regime at entry.
The full-history backtest (2020-03 to 2026-10) lost 98.3% with a 98.8% max drawdown, Sharpe -0.92, profit factor 0.75, a 34% win rate and an average trade of -0.35% of notional over 1,560 trades. The backtest review, which covered the 2020-03 to 2025-06 development period, cites 1,266 positions averaging -0.41%, Sharpe -1.03 and a loss in every calendar year.
Analysis
恒温器策略在发明者量化平台的实践与应用
Backtest and paper results are hypothetical. Trading involves risk of loss.