Commit Graph
2 Commits
Author SHA1 Message Date
cbazzaandClaude Sonnet 4.6 338ed1188c fix: session_filter_patch, advanced_position_management, loss_protection_manager
session_filter_patch.py:
- Fix mutable default arguments (config=None + internal assignment)
- Read confidence threshold from config (95) instead of hardcoded 60
- Read debug flag from config instead of hardcoding True
- Rename datetime parameter to avoid shadowing the module (_datetime import)
- Clamp optimal_interval to max 59 to avoid % modulo issues
- Cache now = _datetime.now() to avoid double call

advanced_position_management.py:
- mt -> mt5 alias (21 replacements)
- should_update_trailing_stop: fetch symbol_info.point once, reuse for both checks
- close_partial_position: fetch mt5.symbol_info_tick once instead of twice
- check_and_update_positions: add mt5.terminal_info() guard

loss_protection_manager.py:
- Fix critical bug: .seconds -> .total_seconds() in news cache check
  (.seconds resets at 1h boundary, causing stale cache to appear fresh)
- _fetch_economic_calendar: activate via news_filter_simple integration,
  document that it was previously a no-op
- record_trade: document approximate balance tracking limitation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 09:55:09 +02:00
cbazzaandClaude Opus 4.5 4ac27cc7b4 feat: Add Loss Protection Manager with multi-layer safety system
- Daily loss limit (2% / $500 max)
- Consecutive loss breaker (3 losses → 2h cooldown)
- Max drawdown circuit breaker (10% threshold)
- News filter with 30min buffer for high-impact events
- Integrated as SCHRITT 0.5 in enhanced_trading_check_wrapper
- Combined lot multiplier with Equity Curve and Reversal Detector

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 17:18:29 +01:00