AI trading tool update - Self learning logic
Have had a few questions around the self learning component. Heres how its built currently
The bot has a simple self-tuning mechanism that adjusts entry filters based on win rate. Here's how it works:
Every 10 completed trades, adapt_thresholds() fires:
Copy
Win rate > 60% → LOOSEN filters (catch more trades)
- min_price_change: -1% (floor: 5%)
- volume_spike_multiplier: -0.1x (floor: 1.2x)
Win rate < 35% → TIGHTEN filters (be pickier)
- min_price_change: +1% (floor: 15%)
- volume_spike_multiplier: +0.1x (floor: 2.5x)
35-60% → no change
The adjusted values live in learning_state.json and override the config defaults. The scanner (scan_for_entries) reads from the learning state first, falling back to config:
Copy
min_change = learning.get("min_price_change_24h", CFG["min_price_change_24h"])
Current defaults: 8% min price change, 1.5x volume spike. These will shift after the first 10 trades close.
Working on the following different models and compare the best strategy
- Per-narrative tracking learn which sectors (AI, L2, privacy) have better hit rates
- Time-of-day weighting track which scan windows produce winners
- Dynamic stop/TP adjust based on volatility (ATR-based) rather than fixed %
- Decay recent losses heavier weight last 10 trades more than lifetime stats