new strat needed

This commit is contained in:
zastian-dev
2026-02-11 22:24:32 +00:00
parent 189694cc09
commit 9cca8b3db8
2 changed files with 76 additions and 120 deletions

View File

@@ -1,33 +1,42 @@
# Quant-Rust-Strategist Memory
## Architecture Overview
- 50-symbol universe across 9 sectors (MAG7, semis, growth tech, healthcare, fintech, financials, industrials, consumer, energy)
- Hybrid momentum + mean-reversion strategy via composite signal scoring in `generate_signal()`
- Backtester restricts buys to top 8 momentum stocks; live mode also uses TOP_MOMENTUM_COUNT=8
- 50-symbol universe across 9 sectors
- Hybrid momentum + mean-reversion via composite signal scoring in `generate_signal()`
- Backtester restricts buys to top 8 momentum stocks (TOP_MOMENTUM_COUNT=8)
- Signal thresholds: StrongBuy>=6.0, Buy>=4.5, Sell<=-3.5, StrongSell<=-6.0
## Critical Finding: Hourly Mode is Catastrophically Broken (2026-02-11)
See [hourly-backtest-analysis-2026-02-11.md](hourly-backtest-analysis-2026-02-11.md) for full details.
## Key Finding: Daily vs Hourly Parameter Sensitivity (2026-02-11)
### Root Causes (Priority Order)
1. **7x period scaling creates absurd indicator requirements**: RSI=98, MACD slow=182, EMA trend=350, momentum=441. min_bars()~450. Most indicators are NaN for majority of the data.
2. **Drawdown halt at 10% is terminal for short backtests**: After -11.44% in 8 days, system sat in 100% cash for 2+ months (Nov 21 to Feb 11). This made the loss permanent.
3. **Churning in opening days**: MU 3x, AMD 3x, GOOGL 3x in first 8 days. Cooldown helps but insufficient when all indicators trigger simultaneously on warmup.
4. **IEX feed**: `feed=iex` gives thin volume, unreliable for hourly OHLCV.
5. **Concentrated sector exposure**: MU, AMD, ASML all semis.
### Daily Timeframe Optimization (Successful)
- Reduced momentum_period 252->63, ema_trend 200->50 in IndicatorParams::daily()
- Reduced warmup from 267 bars to ~70 bars
- Result: Sharpe 0.53->0.86 (+62%), Win rate 40%->50%, PF 1.32->1.52
### Previous Finding: Daily Churning (also 2026-02-11)
See [backtest-analysis-2026-02-11.md](backtest-analysis-2026-02-11.md) for daily mode analysis.
- 12 whipsaw events cost $7,128, 16 same-day round-trips at 0% win rate
- Fixed by: cooldown timer (7 bars), ATR stop widened to 2.0x, buy threshold raised to 4.5
### Hourly Timeframe: DO NOT CHANGE FROM BASELINE
- Hourly IndicatorParams: momentum=63, ema_trend=200 (long lookbacks filter IEX noise)
- Shorter periods (momentum=21, ema_trend=50): CATASTROPHIC -8% loss
- ADX threshold lowered 25->20 (shared const, helps both timeframes)
## Key Parameters (config.rs) - Current as of 2026-02-11
- ATR Stop: 2.0x | ATR Trail: 1.5x distance, 1.5x activation
- Max-loss cap: 4% | Position sizing: 1% risk / ATR_stop_pct, capped at 22%
- Max 6 positions, max 2 per sector | Drawdown halt: 10% | Time exit: 30 bars
- Cooldown: 7 bars | Slippage: 10bps
- Hourly mode: ALL indicator periods multiplied by 7 (HOURS_PER_DAY=7)
### Failed Experiments (avoid repeating)
1. Tighter ATR stop (2.0x): too many stop-outs on hourly. Keep 2.5x
2. Lower buy threshold (3.5): too many weak entries. Keep 4.5
3. More positions (8): spreads capital too thin. Keep 5
4. Higher risk per trade (1.0-1.2%): compounds losses. Keep 0.8%
5. Wider trail (2.5x ATR): misses profit on hourly. Keep 1.5x
6. Lower volume threshold (0.7): bad trades on IEX. Keep 0.8
7. Lower cash reserve (3%): marginal, not worth risk. Keep 5%
## Current Parameters (config.rs)
- ATR Stop: 2.5x | Trail: 1.5x distance, 1.5x activation
- Risk: 0.8%/trade, max 22% position, 5% cash reserve, 4% max loss
- Max 5 positions, 2/sector | Drawdown halt: 10% (35 bars) | Time exit: 30
- Cooldown: 7 bars | Ramp-up: 30 bars | Slippage: 10bps
- Daily params: momentum=63, ema_trend=50
- Hourly params: momentum=63, ema_trend=200
- ADX: threshold=20, strong=35
## Build Notes
- `cargo build --release` compiles clean (only pre-existing dead_code warnings)
- `cargo build --release` compiles clean (only dead_code warnings)
- No tests exist
- Backtests have stochastic variation from IEX data timing