← Back to Research

Research entry

XGBoost Signal Confidence Filter for Algorithmic Trading

Active · March 2026

An XGBoost classifier trained on 3,033 historical signal outcomes that doubles win rate in a live crypto trading system — from 24% to ~50% — by scoring each signal's confidence before execution. Deployed in dry-run with three parallel strategies and a delta-neutral carry layer.

Machine Learning XGBoost Trading Time Series Python TimescaleDB

View external resource →

Overview

A practical application of supervised learning to live algorithmic trading. Three mean-reversion and momentum strategies generate raw trading signals. An XGBoost confidence filter scores each signal before it reaches the execution layer, and drops anything below a calibrated threshold.

The result: win rate doubles from 24% to approximately 50% at a 0.55 confidence threshold, and reaches 71% at a 0.70 threshold. The cost is signal frequency — the filter is conservative and drops most signals, so the system trades less but wins more often.


The Signal Filter

Problem

Raw mean-reversion signals have a baseline win rate of around 24% on the crypto perpetuals markets targeted. Most signals are noise — produced at unfavourable times (wrong volatility regime, adverse time of day, low historical edge) and the strategy has no mechanism to distinguish them from genuine opportunities.

Approach

Training data: 3,033 historical signal outcomes from live and simulated runs. Each outcome is labelled 1 (profit hit take-profit) or 0 (loss hit stop-loss or time-expired flat).

Features (18 total):

  • Price momentum: r_1h, r_4h, r_6h, r_12h, r_24h
  • Volatility: vol_24h, vol_zscore
  • Funding: funding_rate, funding_zscore
  • Time encoding: hour_sin, hour_cos (continuous), day_of_week (one-hot)
  • Signal metadata: threshold_used, signal_strength, market_symbol

Model: XGBoost binary classifier, trained with 80/20 split, ROC-AUC optimisation, class weights balanced for the imbalanced positive class (~24%).

Results

ThresholdWin rateROC-AUCNotes
None (baseline)24%All signals forwarded
0.55~50%0.77Production threshold
0.7071.4%High precision, low recall

Top features by importance:

  1. vol_24h — 24h realised volatility
  2. threshold_used — the strategy’s entry threshold at signal time
  3. hour_cos — time of day (cosine encoding)
  4. dow — day of week
  5. r_6h — 6h price return

Volatility and time of day dominate. The filter has essentially learned that most signals generated during high-volatility periods at certain hours are noise.


Trading Strategies

Three strategies run in parallel and all share the same filter:

Mean-Reversion

Adaptive threshold that scales with 24h volatility (floor 0.6%, cap 2.0%, base 0.9%). Buys when price deviates below a moving average by the threshold, sells when it reverts. SL=2%, TP=1.5%, max hold 6h, position size 5%, max 3 open positions.

Vol-Regime

Adjusts entry aggressiveness based on the 24h vol z-score:

  • High-vol reversal: lower threshold 30% when vol_zscore > 1.0
  • Vol-breakout long: momentum continuation when vol_zscore > 1.5

Funding Rate

Exploits extreme perpetual futures funding rates. A 90-day rolling z-score on the funding rate identifies periods where longs are paying significantly above or below normal. z > 2.0 → short signal (longs overpaying), z < -2.0 → long signal.


Delta-Neutral Carry

A separate infrastructure layer captures funding rates without directional exposure:

Setup: Long spot position on Binance + short perpetual of equal notional on Hyperliquid. The net delta is zero — the position earns (or pays) the funding rate every 8 hours with no market directional risk.

Risk controls: Basis drift monitoring with emergency unwind at 1% basis. Max carry notional 10% of portfolio. Funding z-threshold 2.0 before initiating.

Currently dry-run enabled. The positive-funding path is implemented; the negative-funding path (short spot + long perp) is a planned extension.


Infrastructure

ComponentPurpose
TimescaleDBTime-series storage for candles, signals, trades, equity snapshots
Grafana3 dashboards: Portfolio Risk, Hedge Fund Overview, Crypto Reversal
TelegramDrawdown alerts, health checks, daily P&L summaries
Docker ComposeAll services containerised, deployed on Mac Mini

ML Pipeline

# Feature engineering + training + evaluation (run from MacBook via Tailscale)
TSDB_URL=postgresql://trading:$PASSWORD@connors-mini:5432/trading \
  uv run python -m ml.feature_engineering
uv run python -m ml.train
uv run python -m ml.evaluate

Status

88 tests passing. System in dry-run with continuous live signal generation. The ML filter is the primary bottleneck — it blocks most signals at the current 0.55 threshold, which is the intended behaviour during validation. Plan: go live with copy bot ($50 USDC) followed by crypto bot ($100) after two-week dry-run validation confirms expected behaviour.