Connor Faulkner
← Back to Research

Research entry

XGBoost Signal Confidence Filter for Algorithmic Trading

Completed · March 2026

An XGBoost classifier trained on 3,033 historical signal outcomes that doubles win rate in a crypto trading system — from 24% to ~50% — by scoring each signal's confidence before execution. The filter worked; four months of dry-run evidence then killed most of the strategies it was filtering. Post-mortem included.

Machine Learning XGBoost Trading Time Series Python TimescaleDB

View external resource →

Overview

A practical application of supervised learning to algorithmic trading. Three mean-reversion and momentum strategies generated 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 ran in parallel, all sharing 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.

Built and dry-run enabled, but it never activated: gross funding carry ran between −3% and +2% annualised in 2026, so there was nothing worth capturing. Shelved unless the funding regime changes materially.


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

Where It Ended Up (July 2026)

The filter research above stands. The system it filtered mostly didn’t survive contact with four months of dry-run evidence:

  • Copy-trading bot: retired. 3,122 paper trades over four months, −$224, a 28.3% win rate, negative every single month. A leader-quality filter didn’t restore the edge.
  • Funding-rate strategy and carry layer: shelved. Gross carry between −3% and +2% annualised in 2026 — nothing to harvest.
  • A statistical structure scan killed the rest: daily fade-yesterday reversion’s edge died in 2022 (full-sample t-stats hid it), ETH/BTC is a random walk with a 241-day half-life, and the real sub-daily signals sit roughly 15× below taker fees.

Two strategies earned forward paper runs: monthly cross-sectional momentum (backtest Sharpe 1.68) and a day-of-week seasonality in BTC that replicated out of sample at +0.96 Sharpe net of fees. Both get judged in October 2026 — promotion requires forward Sharpe above 0.5.

The cheapest way to lose $224 is on paper. The full list of killed ideas is on the dead ends page; the live experiments are on now.