cbazza and Claude 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
cbazza and Claude Opus 4.5
ce4e961541
feat: Add Trend Reversal Detector with multi-signal analysis
...
Deploy to Windows VPS / deploy (push) Has been cancelled
New features:
- Reversal Detector with 5 detection signals:
- RSI Divergence (bearish/bullish)
- EMA Slope Change detection
- Volume Spike analysis
- Candlestick patterns (Doji, Engulfing, Hammer, Pin Bar)
- Break of Structure detection
- Integrated into enhanced_trading_check_wrapper (SCHRITT 2.5)
- Defensive mode: blocks trades at 70%+ reversal score
- Lot size reduction at 30-69% reversal score
- Enable Overlap session (13:00-16:00 UTC)
Files added:
- reversal_detector.py: Core detection algorithms
- reversal_integration.py: Bot integration wrapper
- REVERSAL_DETECTOR_INTEGRATION.md: Documentation
Modified:
- TradingBot notebook: Added reversal check integration
- session_filter_patch.py: Enabled overlap session
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-01-30 09:46:40 +01:00
cbazza and Claude Opus 4.5
b5b91224df
feat: Add session filter to trading check + fix drawdown calculation
...
Deploy to Windows VPS / deploy (push) Has been cancelled
- Add session check (SCHRITT 0) to enhanced_trading_check_wrapper
- Fix max_drawdown calculation to cap at 100% when equity goes negative
- Add _save_data() after _update_stats() to persist stats
- Add auto-sync scheduler job for demo tracker (every 5 min)
- Fix MT5 trade sync to match entry deals by position_id
- Enable Asian session in session_filter_patch.py
Session config now:
- Asian: ENABLED
- London: BLOCKED
- Overlap: ENABLED
- NY: ENABLED
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-01-29 10:47:28 +01:00
cbazza
2de5f9f53f
fix: Update external config files to use 0.10 lot size
...
ROOT CAUSE FOUND:
User was right - there was an external config file!
advanced_position_management.py had hardcoded values:
- base_risk = 0.01 (should be 0.02)
- return 0.01 fallback (should be 0.10)
- No min/max lot enforcement
CHANGES:
1. advanced_position_management.py:
✅ base_risk: 0.01 → 0.02 (2% risk)
✅ return fallback: 0.01 → 0.10
✅ volume_min: max(broker_min, 0.10)
✅ volume_max: min(broker_max, 0.20)
2. session_filter_patch.py:
✅ Added lot sizing config:
- min_lot: 0.10
- max_lot: 0.20
- default_lot: 0.10
IMPACT:
- Bot will now use 0.10 minimum lot
- Adaptive sizing respects 0.10-0.20 range
- No more 0.01 lot trades
TESTING NEEDED:
1. Restart kernel
2. Reimport advanced_position_management
3. Verify next trade uses 0.10 lot
🎯 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-01-14 13:48:03 +01:00
cbazza
ce197c06f4
Implement session-specific confidence thresholds (NY Fine-Tuning)
...
FEATURE: Session-Specific Confidence Thresholds
- Asian: >=95% Confidence (unchanged, 97.8% WR)
- NY: >=97% Confidence (NEW, improves WR from 43.3% to 56.5%!)
- London/Overlap: Blocked (as before)
EXPECTED IMPACT:
- Eliminates 7 poor NY trades (all <97% confidence)
- NY Win-Rate: 43.3% → 56.5% (+13.2 pp)
- NY Profit: $1,418 → $1,655 (+$237)
- Total Profit: $8,306 → $8,598 (+$292)
- Overall Win-Rate: 67.8% → ~71%
IMPLEMENTATION:
1. session_filter_patch.py
- Added session_confidence_thresholds config
- New function: get_session_confidence_threshold()
- New function: is_confidence_sufficient()
2. session_confidence_filter.py (NEW)
- Wrapper for execute_trade_v2_adaptive
- Session-specific confidence checks
- Test suite (6/6 tests passed ✅ )
3. analyze_ny_session.py (NEW)
- Detailed NY session analysis
- Simulations for different thresholds
- Data shows 97-98% trades had 100% WR
TESTING:
All 6 test cases passed:
- Asian 96%: ALLOWED ✅
- Asian 94%: BLOCKED ✅
- NY 98%: ALLOWED ✅
- NY 96%: BLOCKED ✅
- London 99%: BLOCKED ✅
- Overlap 99%: BLOCKED ✅
NEXT STEPS:
1. Integrate wrapper into notebook
2. Restart kernel
3. Monitor for 1 week
4. Review performance improvement
FILES:
- session_filter_patch.py: Updated config + new functions
- session_confidence_filter.py: Wrapper implementation
- analyze_ny_session.py: Analysis tool
- NY_SESSION_FINETUNING.md: Complete documentation
2025-12-26 17:46:58 +01:00
cbazza
a1b5d6a190
Increase base risk from 1% to 2% for better position sizing
...
- Changed max_risk_per_trade from 0.01 to 0.02
- Enables Adaptive Position Sizing to work effectively:
- High confidence (≥80%): 3% risk → ~0.03 lot
- Medium confidence (≥70%): 2% risk → ~0.02 lot
- Low confidence (<70%): 1% risk → ~0.01 lot
- Previous 1% base risk resulted in only 0.01 lot trades
2025-12-23 09:27:49 +01:00
cbazza
cbd6584db5
all changes done over the last 2 weeks
2025-12-16 22:02:15 +01:00
cbazza and Claude
596718e30b
feat: Trading Bot V1.8 - Aggressive Mode + Infrastructure
...
## Major Features
- Session Filter: NY-only trading (13:00-21:00 UTC)
- SQLite Database: Structured trade logging
- Telegram Bot: Real-time notifications (@Xausd_digger_bot)
- Streamlit Dashboard: Visual monitoring & analytics
- JSON Import: Historical data migration
## Infrastructure
- trading_database.py: SQLite trade storage
- telegram_notifier.py: Telegram integration
- infrastructure_patch.py: Combined DB + Telegram
- trading_dashboard.py: Real-time web dashboard
- import_json_to_db.py: JSON to SQLite migration
## Session Filter (V1.8 Aggressive Mode)
- session_filter_patch.py: Whitelist-based filter
- Blocks: Asian, London, Overlap sessions
- Active: NY session only (best performance: 47.6% WR)
- Base confidence: 60%
## Documentation
- V1.8_AGGRESSIVE_MODE_AKTIVIERT.md
- FIX_DUPLICATE_SCHEDULER.md
- DASHBOARD_WINDOWS_SERVER.md
- SQLITE_TELEGRAM_SETUP.md
- PROJECT_CLEANUP.md
## Cleanup
- Archived old V1.1-V1.7 versions
- Removed obsolete analysis scripts (replaced by dashboard)
- Added .gitignore for secrets and temp files
## Breaking Changes
- Requires telegram_config.json (use template)
- Requires Python packages: streamlit, plotly
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-26 21:14:01 +01:00