Crypto Mean-Reversion Signal Classifier
XGBoost classifier that predicts whether a mean-reversion trade (triggered when price z-score crosses ±2.0 relative to a rolling 24h mean) will hit a 0.5% profit target within the next 12 hourly candles.
Trained on 1h perpetual futures data for: BTC/USDT:USDT, ETH/USDT:USDT, SOL/USDT:USDT, BNB/USDT:USDT, XRP/USDT:USDT, DOGE/USDT:USDT.
Usage
from huggingface_hub import hf_hub_download
import xgboost as xgb
import json
model_path = hf_hub_download(repo_id="{repo_id}", filename="model.json")
config_path = hf_hub_download(repo_id="{repo_id}", filename="config.json")
model = xgb.XGBClassifier()
model.load_model(model_path)
with open(config_path) as f:
cfg = json.load(f)
# X_new must be a 2D array with columns in exactly this order:
# ['z_score', 'rsi', 'bb_exceeds', 'current_deviation', 'atr_pct', 'adx', 'vol_ratio', 'volume']
prob = model.predict_proba(X_new)[:, 1]
Features expected (in order)
['z_score', 'rsi', 'bb_exceeds', 'current_deviation', 'atr_pct', 'adx', 'vol_ratio', 'volume']
Reported test accuracy
0.9938
Limitations
- Trained on a single ~416-day historical window; regime shifts (e.g. low-volatility vs. trending markets) can degrade performance out of sample.
- Predictions do not account for exchange fees, slippage, or perpetual funding costs.
- This is a research/educational artifact, not financial advice — evaluate carefully before using it to make real trading decisions.
- Downloads last month
- -