Commit Graph
2 Commits
Author SHA1 Message Date
cbazzaandClaude Sonnet 4.6 f37e7adcf3 fix: enhanced_trailing_stop, dynamic_threshold_optimizer, signal_cache
enhanced_trailing_stop.py:
- mt -> mt5 (all occurrences)
- Add pandas + timezone imports at file top
- Fix UTC bug: datetime.fromtimestamp(..., tz=timezone.utc).replace(tzinfo=None)
- Fetch symbol_info once per call, reuse for point (was called twice)
- cleanup_closed_positions: handle None from positions_get()
- Remove pandas import from inside function body

dynamic_threshold_optimizer.py:
- Fix SQL injection: replace f-string session filter with parameterized query (?)
- Add logging module, replace all print() with logger calls
- Use context manager (with sqlite3.connect()) to prevent connection leak on exception
- save_thresholds_to_config: add try/except with logger.error

signal_cache.py:
- Fix bare except -> except Exception in _cleanup_old_entries

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 11:48:38 +02:00
cbazzaandClaude Opus 4.5 d25727839a feat: Add Signal Cache for ML training data collection
- Add signal_cache.py module to persist signal data between trade open/close
- Modify execute_trade_v2_adaptive to cache signal info when trade opens
- Update sync_closed_trades_to_tracker to retrieve cached ML features
- Update scheduled_demo_tracker_sync with same ML feature retrieval

This enables proper ML training by capturing:
- base_confidence, enhanced_score, hybrid_score
- signal_quality, market_regime, regime_strength
- session and lot_multiplier

Previously all trades were logged with 0 values for ML features.
After ~50-100 new trades, the ML model can be properly trained.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 12:50:55 +01:00