mirror of
https://github.com/PyP-Quant/quant-trading-strategy-templates.git
synced 2026-08-18 21:18:05 +00:00
AUDUSD Multi-timeframe trend filter 1m
This strategy implements a multi-timeframe trend filter approach for AUDUSD on 1-minute candles using RandomForestClassifier.
Overview
- Pair: AUDUSD
- Timeframe: 1m
- Model: RandomForestClassifier with feature engineering focused on multi-timeframe trend analysis
- Goal: Trend following strategy that filters signals across multiple timeframes (short, medium, long-term)
Features Engineered
- Returns: 1, 3, 6, 12 period returns
- ATR-normalized price action: Range percentage, body percentage, close position
- Multi-timeframe trend filters:
- Short-term: 5 EMA vs 13 EMA
- Medium-term: 13 EMA vs 34 EMA
- Long-term: 34 EMA vs 89 EMA
- Price position relative to each EMA (5, 13, 34, 89)
- Rolling volatility percentile (from idea): Fast/slow volatility ratio, volatility percentile
- 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
Configuration
See quant.config.json for hyperparameters:
lookback: 100 candles for predictionhorizon: 1 candle forward for labelingthreshold: 0.0004 (4 pips) for ATR-normalized breakoutmin_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.