quick-stats
Scannednpx machina-cli add skill marketcalls/vectorbt-backtesting-skills/quick-stats --openclawGenerate 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 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:
Symbol: SBIN | Exchange: NSE | Interval: D
Strategy: EMA 10/20 Crossover
Period: 2023-01-01 to 2026-02-27
Fees: Delivery Equity (0.111% + Rs 20/order)
-------------------------------------------
Total Return: 45.23%
Sharpe Ratio: 1.45
Sortino Ratio: 2.01
Max Drawdown: -12.34%
Win Rate: 42.5%
Profit Factor: 1.67
Total Trades: 28
-------------------------------------------
Benchmark (NIFTY): 32.10%
Alpha: +13.13%
- Explain key metrics in plain language for normal traders
- Show equity curve plot using Plotly (
template="plotly_dark")
Example Usage
/quick-stats RELIANCE
/quick-stats HDFCBANK NSE 1h
Source
git clone https://github.com/marketcalls/vectorbt-backtesting-skills/blob/master/.claude/skills/quick-stats/SKILL.mdView on GitHub Overview
quick-stats runs a ready-to-use EMA 10/20 backtest directly in a notebook or console without file I/O. It fetches data via OpenAlgo (or yfinance fallback), applies Indian delivery fees, prints a compact performance summary, and renders an equity curve with Plotly for quick inspection. It also benchmarks against NIFTY to give context on alpha and risk.
How This Skill Works
The code fetches symbol data (OpenAlgo by default, with yfinance as a fallback), computes an EMA 10/20 crossover using TA-Lib (not VectorBT built-ins), and cleans signals with ta.exrem() after filling NaN values. It applies Indian delivery fees (fees=0.00111, fixed_fees=20), fetches the NIFTY benchmark via OpenAlgo (NIFTY, NSE_INDEX), and prints a compact summary alongside a Plotly equity curve. No files are written; everything runs inline in a notebook cell or script.
When to Use It
- Quickly evaluate SBIN on NSE with daily data to gauge strategy viability.
- Compare multiple symbols in a notebook by running the same inline backtest without exporting files.
- Assess how Indian delivery fees affect net returns for a quick cost-aware check.
- Benchmark the EMA 10/20 strategy against NIFTY to gauge alpha and relative risk.
- Capture a concise performance snapshot for teaching, tutorials, or quick demonstrations.
Quick Start
- Step 1: Run the quick-stats command with your desired symbol, e.g., /quick-stats SBIN
- Step 2: (Optional) Specify exchange and interval, e.g., /quick-stats SBIN NSE 1h
- Step 3: Paste the generated inline code block into a Jupyter cell or script and execute to view the summary and equity curve
Best Practices
- Install and import TA-Lib; the EMA cross relies on TA-Lib functions (not VectorBT).
- Prefer OpenAlgo as the primary data source; fall back to yfinance if needed.
- Always run .fillna(False) before ta.exrem() to ensure clean signals.
- Use the specified Indian delivery fees (0.111% + Rs 20 per order) to reflect real costs.
- Validate results by comparing the equity curve and benchmark plotly visuals.
Example Use Cases
- SBIN NSE D
- RELIANCE NSE 1h
- HDFCBANK NSE 4h
- SBIN NSE 1d
- NIFTY NSE_INDEX 1d (benchmark)