mirror of
https://github.com/PyP-Quant/quant-trading-strategy-templates.git
synced 2026-08-17 20:48:06 +00:00
ETHUSDT Adaptive threshold classifier 15m
This strategy implements an adaptive threshold classifier approach for ETHUSDT on 15-minute candles using LightGBM.
Overview
- Pair: ETHUSDT
- Timeframe: 15m
- Model: LightGBM with feature engineering focused on adaptive threshold classification
- Goal: Dynamically adjust classification thresholds based on recent volatility and market conditions
Features Engineered
- Basic returns: 1, 2, 4, 8, 16, 32 period returns
- ATR-based features (enhanced from original):
- ATR percentage (ATR/price)
- ATR expansion ratio (short-term/long-term ATR)
- Realized volatility at different timeframes
- Volatility regime indicator
- Volume z-score
- EMA crossovers (9/34 and 21/89)
- Adaptive threshold features:
- Dynamic threshold (2× ATR percentage)
- Volatility percentile ranking
- Momentum features:
- RSI (Relative Strength Index)
- Price position in recent 20-period range
- Volume-price correlation
- Distance from EMAs (from idea): 20, 50, and 200 period EMAs
- Prior swing high and swing low distance (from idea)
- Volume features: Z-score and ratio to moving average
- Rolling volatility percentile (from idea): Fast/slow volatility ratio, volatility percentile
Configuration
See quant.config.json for hyperparameters:
lookback: 100 candles for predictionhorizon: 3 candles forward for labeling (45 minutes for 15m timeframe)threshold: 0.003 (base threshold, adapted dynamically)min_confidence: 0.50 minimum probability for signal generation
Usage
This template follows the PyP Quant Mode contract:
def train(data, config):
return model, metrics
def predict(model, market_data, config):
return {"signal": "UP|DOWN|HOLD", "confidence": 0.0, "metadata": {}}
Disclaimer
Educational template only. Not financial advice. Past performance does not guarantee future results.