Fixed critical issues in historical trade record and performance analysis:
1. PnL Calculation: Changed from percentage-only to actual USDT amount
- Now correctly calculates: positionValue × priceChange% × leverage
- Previously: 100U@5% and 1000U@5% both showed 5.0
- Now: Properly reflects different position sizes and leverage
2. Position Tracking: Added quantity and leverage to open position records
- Store complete trade data for accurate PnL calculation
- Previously only stored: side, openPrice, openTime
- Now includes: quantity, leverage for proper accounting
3. Position Key: Fixed to distinguish long/short positions
- Changed from symbol to symbol_side (e.g., BTCUSDT_long)
- Prevents conflicts when holding both long and short positions
4. Sharpe Ratio: Replaced custom Newton's method with math.Sqrt
- Simplified standard deviation calculation
- More reliable and maintainable
Impact: Win rate, profit factor, and Sharpe ratio now based on accurate USDT amounts
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Major improvements:
- Use period-level Sharpe ratio (range -2 to +2) instead of annualized
- Save full user prompt in decision logs for debugging
- Format complete market data (3m + 4h candles) for AI analysis
- Prevent position stacking with duplicate position checks
- Update Sharpe ratio interpretation thresholds
Market data enhancements:
- Display full technical indicators in user prompt
- Include 3-minute and 4-hour timeframe data
- Add OI (Open Interest) change and funding rate signals
Risk control:
- Block opening duplicate positions (same symbol + direction)
- Suggest close action first before opening new position
- Prevent margin usage from exceeding limits
UI improvements:
- Update multi-language translations
- Refine AI learning dashboard display
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Implement Sharpe ratio calculation in decision logger
- Add adaptive behavior recommendations based on Sharpe ratio
- Display Sharpe ratio in AI learning dashboard with visual indicators
- Enable AI to adjust trading strategy based on risk-adjusted returns
- Color-coded performance levels (red/yellow/green) for easy monitoring
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Frontend trading records and UI enhancements
- Optimized AI prompts and decision engine
- Performance analysis and comparison features
- Binance-style UI improvements
- Multi-AI competition mode (Qwen vs DeepSeek)
- Binance Futures integration
- AI self-learning mechanism
- Professional web dashboard
- Complete risk management system