# backtest > Run backtesting scenarios for trading strategies - Author: maminul007 - Repository: maminul007/trading-platform - Version: 20260208000611 - Stars: 1 - Forks: 0 - Last Updated: 2026-02-07 - Source: https://github.com/maminul007/trading-platform - Web: https://mule.run/skillshub/@@maminul007/trading-platform~backtest:20260208000611 --- --- name: backtest description: Run backtesting scenarios for trading strategies argument-hint: "[strategy|--list|--report]" --- # Backtesting Runner Run backtests for trading strategies using the backtester service. ## Usage - `/backtest` - Run default backtest configuration - `/backtest --list` - List available strategies - `/backtest momentum` - Run backtest for momentum strategy - `/backtest --report` - Generate detailed performance report - `/backtest --start 2023-01-01 --end 2023-12-31` - Custom date range ## Backtester Service Location: `services/backtester/` Key modules: - `backtest_engine.py` - Core backtesting engine - `portfolio.py` - Portfolio management - `metrics.py` - Performance metrics calculation - `main.py` - FastAPI endpoints ## Instructions When this skill is invoked: 1. Parse arguments: - `--list`: List available strategies from config - Strategy name: Run specific strategy backtest - `--report`: Generate detailed HTML/PDF report - `--start/--end`: Custom date range - `--initial-capital`: Starting capital (default: 100000) 2. For listing strategies: - Read strategy configurations - Display name, description, and parameters for each 3. For running backtest: ```bash cd services/backtester python -m backtest_engine --strategy $STRATEGY $DATE_FLAGS ``` 4. After backtest completes, report: - **Returns**: Total return, annualized return, CAGR - **Risk**: Volatility, max drawdown, VaR, CVaR - **Ratios**: Sharpe, Sortino, Calmar - **Trading**: Win rate, profit factor, avg win/loss - **Comparison**: vs benchmark (SPY) 5. If `--report` specified: - Generate equity curve chart - Drawdown visualization - Monthly returns heatmap - Trade log summary - Save to `reports/backtest__.html` ## Performance Metrics | Metric | Good | Excellent | |--------|------|-----------| | Sharpe Ratio | > 1.0 | > 2.0 | | Max Drawdown | < 20% | < 10% | | Win Rate | > 50% | > 60% | | Profit Factor | > 1.5 | > 2.0 |