quick-stats
Inline backtest runner for Indian equities with EMA crossover strategy and benchmark comparison.
- Fetches OHLC data from OpenAlgo (with yfinance fallback) and runs a TA-Lib EMA 10/20 crossover strategy without file creation
- Applies Indian delivery fees (0.111% + Rs 20 per order) and automatically fetches NIFTY benchmark for alpha calculation
- Prints compact results summary including total return, Sharpe/Sortino ratios, max drawdown, win rate, and profit factor with plain-language metric explanations
- Generates an interactive Plotly equity curve chart and accepts symbol, exchange, and interval as command arguments with sensible defaults (SBIN, NSE, daily)
Generate a quick inline backtest and print stats. Do NOT create a file - output code directly for the user to run or execute in a notebook.
Arguments
$0= symbol (e.g., SBIN, RELIANCE). Default: SBIN$1= exchange. Default: NSE$2= interval. Default: D
Instructions
Generate a single code block the user can paste into a Jupyter cell or run as a script. The code must:
- Fetch data from OpenAlgo (or DuckDB if user provides a DB path, or yfinance as fallback)
- Use TA-Lib for EMA 10/20 crossover (never VectorBT built-in)
- Clean signals with
ta.exrem()(always.fillna(False)before exrem) - Use Indian delivery fees:
fees=0.00111, fixed_fees=20 - Fetch NIFTY benchmark via OpenAlgo (
symbol="NIFTY", exchange="NSE_INDEX") - Print a compact results summary:
More from marketcalls/vectorbt-backtesting-skills
backtest
Quick backtest a strategy on a symbol. Creates a complete .py script with data fetch, signals, backtest, stats, and plots.
1.3Kvectorbt-expert
VectorBT backtesting expert. Use when user asks to backtest strategies, create entry/exit signals, analyze portfolio performance, optimize parameters, fetch historical data, use VectorBT/vectorbt, compare strategies, position sizing, equity curves, drawdown charts, or trade analysis. Also triggers for openalgo.ta helpers (exrem, crossover, crossunder, flip, donchian, supertrend).
1.2Koptimize
Optimize strategy parameters using VectorBT. Tests parameter combinations and generates heatmaps.
912strategy-compare
Compare multiple strategies or directions (long vs short vs both) on the same symbol. Generates side-by-side stats table.
877setup
Set up the Python backtesting environment. Detects OS, creates virtual environment, installs dependencies (openalgo, ta-lib, vectorbt, plotly), and creates the backtesting folder structure.
792