Commit graph

2 commits

Author SHA1 Message Date
Claude
3fcdbe48c1 perf(neural-trader): optimize backtesting and risk management
Backtesting:
- Single-pass metrics calculation (was 10+ passes)
- Inline stats: mean, variance, win/loss counts computed together
- Combined drawdown metrics in one pass
- Removed redundant method calls

Risk Management:
- Ring buffers for trade history (O(1) vs O(n) shift/slice)
- Running sum for volatility average (O(1) vs O(n) reduce)
- Incremental loss count tracking

Reduces iteration overhead by ~5-10x for large datasets.
2025-12-31 17:19:03 +00:00
Claude
bca9855278 feat(neural-trader): add integrated trading system
Components:
- DAG-based trading pipeline (4.6ms latency)
  • Parallel execution of LSTM, Sentiment, DRL
  • Signal fusion with configurable weights
  • Kelly-based position sizing

- Backtesting framework
  • Sharpe, Sortino, Calmar ratios
  • Max drawdown, VaR, CVaR
  • Walk-forward analysis
  • Comprehensive trade statistics

- Real data connectors
  • Yahoo Finance (free, historical)
  • Alpha Vantage (sentiment, intraday)
  • Binance (crypto, WebSocket)
  • Rate limiting, caching, retry logic

- Risk management layer
  • Position limits (10% max per position)
  • Stop-losses (fixed, trailing, volatility)
  • Circuit breakers (drawdown, loss rate)
  • Exposure management (leverage control)
2025-12-31 17:02:40 +00:00