← ClaudeAtlas

backtest-lablisted

Backtests rule-based swing ideas on NSE/BSE daily bars with Indian frictions built in: decide on the close and fill at the next open, gap-through stops, slippage, exact per-trade charges by segment and broker (STT, stamp duty, GST, DP), whole shares or lots, circuit-band no-fills, futures-only shorts and an optional STCG/LTCG estimate. Six built-in strategies; CAGR vs buy-and-hold, drawdown, Sharpe/Sortino, profit factor, expectancy in ₹ and R; parameter sweeps with a plateau-or-spike read, walk-forward and Monte Carlo. backtest.py, stdlib only, offline. Use when the user asks: "backtest this strategy", "would a 20/50 crossover have worked on X", "is this edge real or curve-fit", "optimise my parameters", "walk-forward test", "Monte Carlo my trades", "what drawdown should I expect", "do charges kill this idea", "does a NIFTY 200-DMA filter help", or before putting real money behind any mechanical rule.
Shubhamkumartrichy/claude-trading-skills-india · ★ 62 · Testing & QA · score 84
Install: claude install-skill Shubhamkumartrichy/claude-trading-skills-india
# Backtest Lab A backtest cannot prove an idea works. It can show quickly that an idea does not. Judge a rule set by how little it degrades when Indian charges, overnight gaps, unseen years and bad luck are piled on, and treat a spectacular first run as a reason for suspicion. ## Commands ```bash python3 scripts/backtest.py strategies # rules and defaults python3 scripts/backtest.py run --csv tcs.csv --strategy sma-cross --params fast=20 slow=50 python3 scripts/backtest.py run --symbol POLYCAB --strategy 52w-high --risk-pct 1 --tax --trades-csv t.csv python3 scripts/backtest.py run --csv hdfcbank.csv --strategy donchian-breakout --regime-csv nifty.csv python3 scripts/backtest.py run --csv nifty.csv --strategy sma-cross --segment futures --lot-size 65 \ --allow-short --leverage 3 --size-pct 300 python3 scripts/backtest.py sweep --csv tcs.csv --strategy sma-cross --grid fast=10,20,30 slow=50,100,200 python3 scripts/backtest.py walkforward --csv tcs.csv --strategy donchian-breakout \ --grid entry_n=20,40,55 exit_n=10,20 --is-bars 756 --oos-bars 252 python3 scripts/backtest.py montecarlo --csv tcs.csv --strategy ema-pullback --sims 2000 --seed 7 python3 scripts/backtest.py montecarlo --from-trades t.csv --ruin-dd 25 ``` Inputs follow `technical-analysis`: `--csv`, `--candles` (broker-MCP JSON, null candles skipped) or `--symbol` (yfinance, `--period 10y`). `--start` sets the first trading day while earlier bars still warm up the indicat