| name | ma-crossover |
| description | Run a Moving Average Crossover strategy backtest (SMA/EMA) on ClickHouse EOD price history. Use when the user asks "run crossover backtest", "golden cross", "death cross", "moving average backtest", or invokes /ma-crossover. |
Skill: Moving Average Crossover Strategy Backtester
Run a Moving Average Crossover backtest for any stock or ETF in ClickHouse and output metrics and a chart.
Trigger
Use this skill when the user asks:
- "Backtest a golden cross / death cross strategy"
- "Moving average crossover backtester"
- "crossover strategy results"
- "/ma-crossover"
What it does
Runs a long-only cash-exchange backtest:
- Golden Cross (Fast MA > Slow MA) -> Go Long (deploy all capital).
- Death Cross (Fast MA <= Slow MA) -> Exit to Cash (0% returns).
- Computes CAGR, Sharpe, Win Rate, and Max Drawdown.
- Generates a dark-themed performance plot in
output/reports/<symbol>_crossover.png.
Usage
python src/main.py crossover --symbol GOLDBEES --fast 50 --slow 200 --type sma
Options
--symbol / -s (str): NSE ticker symbol to analyze (default: GOLDBEES).
--fast / -f (int): Fast moving average period (default: 50).
--slow / -l (int): Slow moving average period (default: 200).
--type / -t (str): MA type: sma or ema (default: sma).
--no-plot (bool): Disable saving the chart.