- Untrack .claude/settings.local.json (IDE-specific)
- Gitignore: data/bot_status.json, signal_persistence.json, model_metrics.json
- Gitignore: logs/ (all content, not just *.log)
- Gitignore: backtests/.claude/
- Add scripts/check_trade_detail.py utility
- Update data/risk_state.txt to current state
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Dark mode: class-based theme toggle with localStorage persistence and flash prevention
- Trade History (/trades): paginated table, stats cards, equity curve chart with DB API endpoints
- Backtest Viewer (/backtests): log parser for 35 backtest results, sidebar + detail + comparison tabs
- Model Insights: dashboard card + dialog showing feature importance, regime distribution, training history
- Alert/Signal Log (/alerts): signal stats, filterable table with execution tracking
- API: 8 new endpoints with psycopg2 DB connection pool
- Dark mode sweep across books page, about dialog, and all dashboard components
- Architecture docs rewritten with Mermaid diagrams (23 docs)
- README and FEATURES.md rewritten bilingual (Indonesian + English)
- main_live.py: write model_metrics.json on startup and retrain
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Delete temp files: _tmp_analysis.py, nul, dashboard_screenshot.png
- Move ea/ to archive/ea/ (deprecated)
- Move 12 Docker helper scripts (.bat/.sh) to docker/scripts/
- Move 5 Docker docs to docker/docs/
- Move .env.docker.example, requirements-docker.txt to docker/
- Update all scripts with cd to project root for correct path resolution
- Update all doc references to new paths
- Update .gitignore with bot.pid, bot_output.log, *.png patterns
- Update CLAUDE.md, README.md directory trees
Root reduced from ~40 files to 12 essential files.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1. Activate SmartPositionManager (was dead code) - trailing SL, breakeven,
market close handler, drawdown-from-peak protection now wired into live loop
2. Add flash crash detection between candles - _position_check_only() now
checks for flash crashes every 5s instead of only on 15min candle close
3. Fix signal confirmation persistence - use direction-based key instead of
exact price (which changed every candle), persist to file to survive restarts
4. Cache ML/features between candles - stop recalculating 37 features + XGBoost
every 5 seconds when candle hasn't changed, reuse cached values
5. Add H1 multi-timeframe SMC bias filter - fetch H1 data, analyze BOS/CHoCH/OB,
block M15 signals that contradict H1 bias, boost confidence when aligned
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix 'dict' has no attribute 'spread' by using .get("spread", 0)
- Add 3-retry loop to close_position() with fresh price each attempt
- Match retry pattern from send_order() for consistency
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Move utility scripts to scripts/ (check_market, check_positions, etc.)
- Move test files to tests/ (test_modules, test_mt5_connection, etc.)
- Move deprecated dashboards to archive/
- Move research files to docs/research/
- Add sys.path fix to all moved Python files
- Rewrite README.md with architecture diagram and badges
- Add CLAUDE.md project guide
- Add MIT LICENSE
- Update .gitignore with archive/ pattern
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Major Issue #1: Confidence Calculation Calibration
- Added calculate_confidence() method with weighted scoring
- Base 40% + Structure 15% + BOS/CHoCH 12% + FVG 8% + OB 10% + Trend 10%
- Capped at 85% (never 100% certain)
Major Issue #2: Pullback Filter ATR-based
- Replaced hardcoded $2, $1.5 thresholds
- Now uses bounce_threshold = 0.15 * ATR
- consolidation_threshold = 0.10 * ATR
Major Issue #3: Smarter Time-based Exit
- Don't cut winners short if profit growing
- Check ML agreement before timeout
- Extend time to 8h if profit > $10 and growing
Major Issue #4: Slippage Validation
- Check actual vs expected price after execution
- Log warning if slippage > 0.15% of price
- Use actual price for position tracking
Major Issue #5: Partial Fill Handling
- Check if filled volume < requested volume
- Log warning with fill ratio
- Use actual volume for position tracking
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Loop: ~1 detik → candle-based (M15) + position check ~10 detik
- Exit Kondisi 3: Golden Time Hold → Early Cut (Smart Hold dihapus)
- AUC rollback threshold: 0.52 → 0.60
- Train/test: tambah 50-bar gap info
- Timer periodik: candle-based intervals
- Performance: split full analysis vs position-check-only
- Golden Time: hapus referensi hold losers
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add model backups from training sessions
- Add training data parquet file
- Add risk state persistence file
- Add research documents (Gemini analysis)
- Update architecture docs
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
main_live.py:
- Switch main loop from time-based (1s) to candle-based (M15)
- Add position-only checks between candles (every 10s)
- Fix memory leak in signal persistence dict (cleanup stale entries)
- Raise auto-retrain rollback AUC threshold from 0.52 to 0.60
src/ml_model.py:
- Add 50-bar gap between train/test split to prevent temporal leakage
src/smart_risk_manager.py:
- Remove dangerous "Smart Hold" behavior (holding losers waiting for golden time)
- Replace with proper early cut logic (loss >30% + negative momentum)
src/smc_polars.py:
- Fix lookahead bias in FVG detection (remove shift(-1), use confirmed bars only)
- Fix lookahead bias in Swing Points (use center=False rolling window)
- Fix lookahead bias in Order Blocks (validate with current bar, not future)
- Enforce minimum 1:2 Risk:Reward ratio on all signals
- Always use current_close as entry price (no stale FVG/OB zone prices)
- Add ATR sanity check with realistic XAUUSD default ($12)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- XGBoost ML model with 37 features for market direction prediction
- Smart Money Concepts (SMC): Order Blocks, FVG, BOS, CHoCH
- HMM market regime detection (trending/ranging/volatile)
- ATR-based stop loss with 1.5 ATR minimum distance
- Broker-level SL protection with fallback
- Time-based exit (max 6 hours per trade)
- Session-aware trading optimized for London/NY overlap
- Auto-retraining based on market conditions
- Telegram notifications and web dashboard
- Backtest results: 63.9% win rate, 2.64 profit factor, 4.83 Sharpe
Backtest period: Jan 2025 - Feb 2026, 654 trades, $4,189 net P/L
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>