tubakhxn
This is a modular Python backtesting engine for evaluating trading strategies on historical financial data. It supports plug-and-play strategies, realistic trade simulation, and comprehensive performance metrics and visualizations.
- Load historical price data (CSV or Yahoo Finance)
- Modular strategy system (easily add new strategies)
- Built-in strategies: Moving Average Crossover, Mean Reversion (z-score)
- Simulate trades with transaction costs
- Track portfolio value and performance
- Metrics: Total Return, Sharpe Ratio, Max Drawdown, Win Rate
- Visualizations: Price with signals, Equity curve, Drawdown
- Fork this repository on GitHub (or download the code).
- Install dependencies:
pip install -r requirements.txt # or manually: pip install pandas numpy matplotlib yfinance - Run
main.pyto start backtesting with default settings. - Modify or add strategies in the
strategies/folder. - Use your own data by editing
main.pyto load a CSV or change the ticker.