Backtesting MRB-2

Momentum-Reversion Bot

Statistical arbitrage bot that combines momentum and mean-reversion signals using ensemble ML models for crypto perpetual futures.

1.8 Sharpe Ratio
27% Annual Return
12.1% Max Drawdown
58% Win Rate
Tech Stack
PythonXGBoostLightGBMBinance APIPostgreSQL

Strategy Thesis

The Momentum-Reversion Bot (MRB-2) is built on a well-documented market microstructure phenomenon: momentum and mean-reversion coexist across different timeframes and regimes. In trending markets, momentum dominates at the 4H-1D scale; in range-bound conditions, mean-reversion dominates at the 15m-1H scale. The core insight is that a regime classifier can dynamically blend these two signal types to produce a composite alpha signal that’s more robust than either alone.

MRB-2 trades perpetual futures on 12 liquid crypto assets (BTC, ETH, SOL, AVAX, DOGE, ARB, LINK, MATIC, OP, APT, INJ, SUI) using up to 3x leverage on isolated margin. The strategy is market-neutral by construction — it maintains roughly balanced long and short exposure across the portfolio at all times.

Feature Engineering

The feature set is divided into three categories, each targeting a different aspect of market dynamics:

Momentum Features — Rate of change across multiple lookback windows (12H, 1D, 3D, 7D, 14D), normalized by asset-specific volatility. Relative momentum rank within the 12-asset universe. Breakout scores measuring distance from Donchian channel boundaries.

Reversion Features — Z-score of price relative to VWAP over 4H and 24H windows. Bollinger Band percentile position. RSI divergence (price making new highs while RSI declines). Funding rate deviation from trailing mean — elevated funding rates on perpetual futures are a strong mean-reversion signal as they create a carry cost that naturally pulls price back.

Regime Features — Realized volatility ratio (short-term vs long-term) to classify volatility regimes. Hurst exponent estimated via rescaled range analysis to measure trendiness. ADX (Average Directional Index) as a trend strength filter. Cross-asset correlation rolling average — when correlations spike (typically in risk-off events), individual asset signals become unreliable and the system reduces exposure.

All features are computed with a strict as_of timestamp to prevent lookahead bias. The entire feature pipeline is unit-tested with synthetic data where we inject known signals and verify the computed features match expected values.

Ensemble Model Architecture

Rather than relying on a single model, MRB-2 uses a stacked ensemble of three gradient-boosted tree models:

  1. XGBoost Momentum Model — Trained on momentum features to predict 4H forward returns. Uses binary:logistic objective with a custom threshold calibrated for precision (we’d rather miss trades than take bad ones).

  2. LightGBM Reversion Model — Trained on reversion features to predict 1H mean-reversion opportunities. LightGBM’s leaf-wise growth strategy handles the high-cardinality regime features more efficiently than XGBoost’s depth-wise approach.

  3. Meta-Learner (Logistic Regression) — A simple logistic regression model that takes the probability outputs from models 1 and 2, plus the regime features, and produces a final signal. The simplicity of the meta-learner is intentional — it’s far less likely to overfit than a deep model stacking layer.

The ensemble is retrained daily on a rolling 6-month window. Each component model uses Optuna for Bayesian hyperparameter optimization with a custom objective function that maximizes out-of-sample Sharpe ratio rather than log-loss. This alignment between the optimization objective and the actual trading objective is critical — a model that minimizes classification error isn’t necessarily the one that makes the most money.

Current Backtesting Results

Walk-forward backtesting across January 2023 – March 2026 shows a Sharpe ratio of 1.8 with a maximum drawdown of 12.1%. The strategy’s monthly return distribution is positively skewed (skew = 0.4), meaning the right tail is fatter than the left — large winning months outweigh large losing months.

Key performance characteristics:

  • Average holding period: 6.2 hours
  • Average trades per day: 8-12 across the 12-asset universe
  • Profit factor: 1.45
  • Worst monthly return: -4.8% (March 2023, post-SVB banking crisis)
  • Best monthly return: +9.2% (October 2024, pre-election volatility)

The strategy shows consistent positive performance across both bull and bear market regimes, with the highest Sharpe ratios during transitional periods (regime shifts) where the momentum-reversion blending provides the most value.

I’m currently running the system on paper trading through Binance Testnet to validate execution assumptions before deploying live capital. The primary concern is slippage on the mid-cap assets (ARB, OP, INJ, SUI) where orderbook depth is thinner. Early paper trading results show approximately 3-5bps of additional slippage beyond the backtesting model, which compresses the Sharpe from 1.8 to an estimated 1.5 in live conditions.