Skip to content
All strategies

Strategies

Leeks Reaper Port (FMZ #34388 by Zero, after richox/okcoin-leeks-reaper): Price-Burst Chase + Gradual Rebalance-to-Neutral, Long-Short on BTCUSD_PERP.BINANCE_CM 1H, Burst Threshold Rescaled from 280ms Sampling by sqrt(time)

Outcome: Abandoned

BtcCmLeeksReaperBurstRebalanceLS

Outcome Summary

This strategy ported the fee-free OKCoin 'Leeks Reaper' burst-chase and rebalance-to-neutral logic to hourly bars on the COIN-M BTC perpetual, keeping every rule and rescaling only the burst threshold by sqrt(time). After 2 iterations, the backtest showed negative expectancy from the first months (Sep to Nov 2020 were already losing). Exposure ran at 94% instead of the planned 35-45%, and the account was liquidated in February 2021 (-100%, Sharpe -3.71, PF 0.80, -0.26% per trade). The analyst abandoned it at backtest review without optimizing, and noted a possible, unverified inverse-sizing anomaly that did not change the sign of the edge.

Hypothesis

Port of the FMZ strategy '移植 OKCoin 韭菜收割机' by Zero (a port of richox/okcoin-leeks-reaper). Credit: the strategy is by those authors; this is our own reimplementation of the rules, not their code. CLASSIFICATION: (a) concrete trading idea. Its two parts are: (1) TREND: when a depth-weighted mid price breaks out of the recent sample range by more than a small percentage threshold, go all-in in the burst direction ('chase rises, kill falls'), with size scaled down when recent traded volume is thin and further scaled……Show moreShow less

Port of the FMZ strategy '移植 OKCoin 韭菜收割机' by Zero (a port of richox/okcoin-leeks-reaper). Credit: the strategy is by those authors; this is our own reimplementation of the rules, not their code. CLASSIFICATION: (a) concrete trading idea. Its two parts are: (1) TREND: when a depth-weighted mid price breaks out of the recent sample range by more than a small percentage threshold, go all-in in the burst direction ('chase rises, kill falls'), with size scaled down when recent traded volume is thin and further scaled down just after a previous burst trade; (2) BALANCE: whenever the book is away from the neutral 50% position (which for the author meant zero net exposure, because the account was balanced with borrowed coin), keep shaving small slices off it until it is back to neutral, so gains are banked and the end of the trend is not held. HONEST VIABILITY NOTE: the author of the original says it stopped working once OKCoin started charging fees. A literal port with the original numbers is fee-dead here and cannot be backtested: the burst threshold is 0.005% of price (5e-5), checked every 280 ms, against a ~0.10% taker round trip. It also needs 3-level order-book snapshots, which we do not have as multi-year history. The user asked for a faithful port but also allowed adapting a non-viable idea, so ONLY TIME SCALE and VENUE are changed. Every rule is kept (burst test shape, 0.7/0.3 volume EMA, volume scaling, 0.8x/0.64x post-trade damping, all-in sizing, flip on opposite burst, 0.48/0.52 neutral band, rebalance in small clips). The one numeric change is to the threshold, and it follows a stated rule rather than a fit: a random-walk move grows with the square root of time, so a 5e-5 move per 280 ms sample becomes 5e-5 * sqrt(3600/0.28) = 0.567% per 1-hour sample. The volume threshold (10 BTC per 280 ms poll on 2016 OKCoin) has no meaning for a 2026 contract venue, so it becomes a relative test: the volume EMA compared with its own trailing 30-day median. VENUE: BTCUSD_PERP.BINANCE_CM (inverse COIN-M perp, 2020-08 to now on 1H, about 6 years). The original is a BTC strategy, which is why BTC is kept even though BTC is already heavily used in the corpus. Putting it on COIN-M moves the run off the 68%-share BINANCE USD-M bucket into the under-quota COIN-M bucket (3.1% vs the >=5% target). The inverse BTC-margined account also matches the original's coin-plus-cash balanced account, where the neutral point meant no fiat P&L swing. The trigger uses price and volume only, with no supplementary feed, so the lesson-160 COIN-M problem (no funding/OI collector) does not apply. Flat state: the strategy is flat whenever the rebalance has brought exposure back inside the neutral band. Expected time in market is ~35-45% (about 2-4 bursts a week, each unwound over about 24 hours).

Iteration 2 fixes the QA critical: sizing used the static USDT balance, which never moves on an inverse account because PnL and fees settle in BTC. The result was constant ~$100k notional, 187% average exposure and liquidation. Sizing now uses mark-to-market USD equity = stable balance + (BTC balance - BTC baseline captured on the first bar + unrealized BTC PnL) * close. Contracts are hard-capped at equity*alloc_frac*leverage/multiplier, which is <=1x equity at leverage 1, so exposure shrinks as equity falls. The……Show moreShow less

Iteration 2 fixes the QA critical: sizing used the static USDT balance, which never moves on an inverse account because PnL and fees settle in BTC. The result was constant ~$100k notional, 187% average exposure and liquidation. Sizing now uses mark-to-market USD equity = stable balance + (BTC balance - BTC baseline captured on the first bar + unrealized BTC PnL) * close. Contracts are hard-capped at equity*alloc_frac*leverage/multiplier, which is <=1x equity at leverage 1, so exposure shrinks as equity falls. The neutral band is corrected to 0.02 (the 0.48/0.52 band is +/-2% of assets). After a restart the damping clock is rebuilt from the open position's ts_opened, and the docstring is corrected. The burst threshold is kept at the hypothesis's pre-stated sqrt(time) value of 0.567% rather than fitted, so burst frequency stays whatever that rule gives. I agree with QA's concern that on 1H BTC this threshold sits near ordinary hourly noise (~2 bursts/day, not 2-4/week). If the corrected backtest confirms fee drag, the honest reading is that the sqrt-time rescaling does not preserve the original's 'rare burst' character. Signal logic, polarity and the rebalance mechanics are unchanged.

negative_expectancy: on a reliable 640-trade sample the per-trade return is -0.26% (the COIN-M floor is +0.10%), PF is 0.80 and Sharpe is -3.71 (CI -6.74 to -2.22), and the account was liquidated in Feb 2021. The pre-registered sqrt(time) threshold of 0.567% per hour falls inside normal hourly BTC noise. That gives 94% exposure instead of the rare-burst 35-45%, and each flip or clip pays taker cost on a gross edge that is already about zero. QA's edge concern is borne out. Retuning the threshold would drop the pre-registered rule, so optimization is not justified (lesson 141: a negative Sharpe on more than 100 trades). A possible inverse-sizing anomaly (-29% daily moves at 1x) is noted but unverified, and it does not change the sign of the edge, which was already negative in Sep-Nov 2020. First-report failure code: fee_edge / no_edge.

Implementation

Leeks Reaper port on BTCUSD_PERP COIN-M 1H. A close that breaks the prior 5-close range by more than 0.567% (5e-5 per 280 ms rescaled by sqrt(time)) triggers an all-in position in the burst direction, capped at 1x mark-to-market USD equity. Size is scaled by the volume EMA against its 30-day median and damped 0.8x/0.64x after a recent burst. An opposite burst flips the book. Otherwise the position is shaved in ~1/24 clips each bar until it is inside a +/-2%-of-equity neutral band, then closed.

Verification Results

Route refills through _submit_entry_instrument, or check self._market_ready(self.instrument_id) before submitting.

Same-direction refills and rebalance clips call self._market() directly, going around _submit_entry/_submit_exit. That skips the base template's min-notional and market-ready guards. Harmless in backtest (clip >= 1 contract = $100 > $5), but in live/paper a clip or refill can go out before the market is ready.

Set the burst state in on_order_filled / on_position_opened instead of in position_size().

position_size() stamps _last_burst_ts, _entry_contracts and _pos_dir as a side effect before the base template decides to submit. If the base refuses the entry (min notional, market not ready), the damping clock and clip base still move as if a burst trade happened.

Leave as is, or raise it to vol_median_window if a full 30-day median should be in place before the first trade.

The min_bars_required override (48) shadows the framework method. The strategy's own gates (7 closes, 24 volume-EMA samples) are both below 48, so this is safe. But the volume median runs on only 24-720 samples for the first 30 days, so early volume scaling is noisier than the stated 30-day median.

The smoke test went to -100% (tracker liquidation on 2025-07-10). At <=1x equity, equity has to fall to the 0.5% maintenance buffer before that fires, so this is cost erosion, not a sizing blowup. Commissions were $55.6k plus $25.3k impact on $100k, turnover 504x, 1312 positions in 715 days (~1.8 bursts/day against the hypothesis's 2-4/week), exposure 85% against 35-45%, PF 0.77. The pre-stated sqrt(time) threshold of 0.567% sits inside ordinary hourly BTC noise, so the 'rare burst' premise does not survive the rescale. Every flip is a full 1x round trip, and the ~24 reduce-only clips add more taker cost on top. PF 0.77 on >1000 trades is just above the polarity-suspicion zone. Check first: burst frequency per year, and PnL before costs per burst. If gross edge per burst is below ~0.2%, abandon rather than retune the threshold, because retuning drops the pre-registered rule.

Backtest Review

Sharpe
-3.71
Total return
-100.00%
Max drawdown
100.00%
Trades
640
Win rate
41.7%
Profit factor
0.80

Faithful port: the pre-registered sqrt(time) threshold rescale was kept, not fitted

Trades are two-sided (322 long / 318 short), which matches the chase-rises/kill-falls design

Account liquidated (total_return -100%, liquidation 2021-02-17): the full history was never tested past the first ~5 months

Negative expectancy on a reliable sample: 640 trades, PF 0.80, avg_trade_return_pct -0.26% (the BINANCE_CM cost floor is +0.10%), Sharpe -3.71, bootstrap CI [-6.74, -2.22]

The losses started before any sizing compounding: monthly returns were -6.4% (Sep), -7.8% (Oct) and -16.4% (Nov 2020) at normal equity, and rolling Sharpe was negative almost from the start

Frequency/exposure mismatch with the premise: exposure was 94% against the stated 35-45%, and entry_signaled was 5354 over ~150 days. The 0.567% hourly threshold sits inside ordinary BTC hourly noise, so 'bursts' are not rare events

Costs were heavy on top of a gross edge that is already about zero or negative: commission $29.9k plus impact $26.7k on $100k starting capital; turnover 1340x

Fat left tail: skew -7.75, tail_ratio 0.34, CVaR95 26.9%. Daily losses of -29% and -30% in Jan 2021 look large for a book capped at <=1x equity, so the inverse-contract equity/sizing path may also have a defect (not verified). Even so, the sign of the edge was already negative before those days

Iteration History

Verification failed (Layer 4 — QA review) [class=code_defect]: - [edge_concern] The strategy fires far more often than the hypothesis expects. It stated 2-4 bursts a week and 35-45% time in market; the sandbox shows 659 positions in 342 days (~2 a day), 88.65% exposure, and commission equal to 22.56% of gross (every 1/24 rebalance clip pays the taker fee). PF 0.75 over 659 trades is close to the lesson-125 polarity-suspicion zone. The polarity checks out (a break above the prior max is a BUY), so the likelier……Show moreShow less

Verification failed (Layer 4 — QA review) [class=code_defect]: - [edge_concern] The strategy fires far more often than the hypothesis expects. It stated 2-4 bursts a week and 35-45% time in market; the sandbox shows 659 positions in 342 days (~2 a day), 88.65% exposure, and commission equal to 22.56% of gross (every 1/24 rebalance clip pays the taker fee). PF 0.75 over 659 trades is close to the lesson-125 polarity-suspicion zone. The polarity checks out (a break above the prior max is a BUY), so the likelier explanation is that the sqrt(time)-rescaled 0.567% threshold sits inside ordinary 1H BTC noise (hourly sigma is about 0.4-0.7%). That turns the 'burst' into a noise trigger with a 24-clip fee tail. After fixing the sizing, check how often bursts fire per week against the hypothesis's 2-4 before spending the optimizer on it. - [critical] The 'all-in 1x equity' sizing is not equity-relative on this venue. _target_contracts() sizes as get_account_equity() * alloc_frac * leverage. On BINANCE_CM, resolve_account_equity() returns the venue's USDT balance, which the runner seeds at 100,000 USDT. Inverse PnL and commissions settle in BTC (the runner also seeds 50 BTC for that), so the USDT balance never moves. Every burst and every refill therefore sizes a fixed ~$100k notional (1000 contracts), no matter how much has been lost. The sandbox shows the result: avg_position_pct 187% on a configured leverage of 1.0, liquidated=true on 2025-05-01, total_return -100%, DD 100%. The hypothesis specifies all-in at 1x equity with post-trade damping. What actually ran is a constant-notional book whose real leverage rises as equity falls, with no stop. That is the compounding-blowup pattern from lessons 148/156, and it breaks the stated sizing. (line 131) — fix: Size from mark-to-market equity in USD. For example: equity_usd = USDT balance + (BTC balance - seeded BTC) * close, or track realized plus unrealized PnL of the inverse position in USD inside the strategy (pos.unrealized_pnl / realized_pnl are in BTC, so multiply by close). Clamp the target so contracts * multiplier <= equity_usd * alloc_frac * leverage, and assert it is <= 1.0x equity at leverage 1. Check the sandbox avg_position_pct afterwards: it should be <= ~100%, with no liquidation. - [warning] The neutral band is 4% of equity (neutral_band_frac=0.04). The original's 0.48/0.52 band is +/-2% of total assets around the 50% ratio. Measured as notional distance from neutral that is 2%, not 4%, unless the 'all-in' leg is defined as 50% of assets. The effect is small (the book flattens one or two clips early), but the mapping should be stated or corrected. (line 176) — fix: Use 0.02, or document why the full band width is used. - [warning] Every same-direction burst calls _mark_burst(), which resets _last_burst_ts and sets _entry_contracts to max(target, held). Refills and damping therefore restart on every consecutive burst bar. This matches the original's per-tick behaviour, but at the sandbox burst frequency (~2 a day) it keeps the book near full size most of the time (88.65% exposure) instead of unwinding over ~24h. (line 150) — fix: Behaviour follows the port, so no change is required. If the burst rate is recalibrated, re-check exposure against the hypothesis's 35-45%. - [warning] The docstring says per-position scalar state is 'restart-safe/persisted'. However, _entry_contracts, _pos_dir and _last_burst_ts are plain attributes. A live warmup replay runs calculate_signal only, so after a restart they are 0. The clip base then falls back to the held size, which is correct, but damping is lost for up to 10 bars. Minor. (line 60) — fix: Rebuild _last_burst_ts from the open position's ts_opened on start, or accept this and fix the docstring.

Outcome Summary

Scaling a sub-second microstructure threshold to hourly bars by sqrt(time) does not keep it a rare-event filter; check that a rescaled trigger actually lands in the tail of the target timeframe's move distribution before building on it.

At backtest review the analyst chose to abandon for negative expectancy: -0.26% per trade against the +0.10% COIN-M floor. The 0.567% hourly threshold sits inside normal BTC noise, so bursts fired constantly and fees ate a gross edge that was already about zero. Re-tuning the threshold would have dropped the pre-registered rule, so optimization was not run.

A port of the FMZ/richox 'Leeks Reaper' to BTCUSD_PERP.BINANCE_CM 1H: go all-in in the direction of a price burst (with volume scaling and post-trade damping), then trim the position back to neutral in small clips, using a pre-registered burst threshold of 0.567% per hour (the original 280 ms threshold scaled by sqrt(time)).

The initial backtest lost everything: total return -100% with the account liquidated on 2021-02-17, Sharpe -3.71 (CI -6.74 to -2.22), 640 trades with 41.7% win rate, profit factor 0.80 and avg_trade_return_pct -0.26%. Exposure was 94.3%, and costs were heavy: $29.9k in commission plus $26.7k in impact on $100k starting capital, with turnover of 1340x.

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