feat: trading bot MVP — ICT Order Block + Liquidity Sweep strategy

Full-stack trading bot with:
- FastAPI backend with ICT strategy (Order Block + Liquidity Sweep detection)
- Backtester engine with rolling window, spread simulation, and performance metrics
- Hybrid market data service (yfinance + TwelveData with rate limiting + SQLite cache)
- Simulated exchange for paper trading
- React/TypeScript frontend with TradingView lightweight-charts v5
- Live dashboard with candlestick chart, OHLC legend, trade markers
- Backtest page with configurable parameters, equity curve, and trade table
- WebSocket support for real-time updates
- Bot runner with asyncio loop for automated trading

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-24 23:25:51 +01:00
commit 4df8d53b1a
58 changed files with 7484 additions and 0 deletions

18
backend/.env.example Normal file
View File

@@ -0,0 +1,18 @@
# TwelveData API (données intraday historiques au-delà des limites yfinance)
# Clé gratuite sur https://twelvedata.com/ — 800 req/jour
TWELVEDATA_API_KEY=your_twelvedata_key_here
# OANDA API (optionnel — pour le trading réel via broker)
OANDA_API_KEY=your_api_key_here
OANDA_ACCOUNT_ID=your_account_id_here
OANDA_ENVIRONMENT=practice
# Bot Configuration
BOT_DEFAULT_INSTRUMENT=EUR_USD
BOT_DEFAULT_GRANULARITY=H1
BOT_RISK_PERCENT=1.0
BOT_RR_RATIO=2.0
BOT_INITIAL_BALANCE=10000.0
# Database
DATABASE_URL=sqlite+aiosqlite:///./trader_bot.db