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>
23 lines
626 B
Python
23 lines
626 B
Python
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8")
|
|
|
|
# TwelveData (fallback pour l'intraday historique)
|
|
# Clé gratuite sur https://twelvedata.com/
|
|
twelvedata_api_key: str = ""
|
|
|
|
# Bot defaults
|
|
bot_default_instrument: str = "EUR_USD"
|
|
bot_default_granularity: str = "H1"
|
|
bot_risk_percent: float = 1.0
|
|
bot_rr_ratio: float = 2.0
|
|
bot_initial_balance: float = 10_000.0
|
|
|
|
# Database
|
|
database_url: str = "sqlite+aiosqlite:///./trader_bot.db"
|
|
|
|
|
|
settings = Settings()
|