PythonBacktraderDhan SDKSQLAlchemyPostgreSQL
Algorithmic Trading System
A Backtrader-based system for backtesting MACD and Bollinger Band strategies with parameter optimization via permutations, ranked by Sharpe ratio, max drawdown, win rate, and IRR.
A
The Challenge
Parameter space for strategy optimization is exponentially large. Brute-force evaluation across all combinations was too slow for iterative development.
The Solution
Parallelized parameter evaluation using ProcessPoolExecutor across CPU cores. Results are ranked by composite score and persisted for paper trading.
Key Outcomes
- 10x faster optimization vs. single-threaded
- Live paper trading via Dhan SDK
- Exchange-accurate commission & tax models
- Automated best-parameter promotion to live