Files
quant-trading-strategy-temp…/templates/ethusdt-adaptive-threshold-classifier-15m

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

  1. Basic returns: 1, 2, 4, 8, 16, 32 period returns
  2. 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)
  3. Adaptive threshold features:
    • Dynamic threshold (2× ATR percentage)
    • Volatility percentile ranking
  4. Momentum features:
    • RSI (Relative Strength Index)
    • Price position in recent 20-period range
    • Volume-price correlation
  5. Distance from EMAs (from idea): 20, 50, and 200 period EMAs
  6. Prior swing high and swing low distance (from idea)
  7. Volume features: Z-score and ratio to moving average
  8. Rolling volatility percentile (from idea): Fast/slow volatility ratio, volatility percentile

Configuration

See quant.config.json for hyperparameters:

  • lookback: 100 candles for prediction
  • horizon: 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.