Skip to content
Back to search

vectorbt-backtesting-skills

Agentic coding skills for backtesting trading strategies using VectorBT. Supports Indian, US, and Crypto markets with realistic transaction cost modeling, TA-Lib indicators, QuantStats tearsheets, and 12 ready-made strategy templates.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/marketcalls-vectorbt-backtesting-skills/badge.svg)](/listings/marketcalls-vectorbt-backtesting-skills)

HTML

<a href="/listings/marketcalls-vectorbt-backtesting-skills"><img src="/api/listings/marketcalls-vectorbt-backtesting-skills/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Install the skills into your project using [npx skills](https://github.com/vercel-labs/skills). The CLI auto-detects your AI coding agent and installs skills to the correct directory.

# GitHub shorthand
npx skills add marketcalls/vectorbt-backtesting-skills

# Full GitHub URL
npx skills add https://github.com/marketcalls/vectorbt-backtesting-skills

Install a specific skill only:

npx skills add marketcalls/vectorbt-backtesting-skills -s backtest
npx skills add marketcalls/vectorbt-backtesting-skills -s optimize
npx skills add marketcalls/vectorbt-backtesting-skills -s vectorbt-expert
npx skills add marketcalls/vectorbt-backtesting-skills -s setup

List available skills before installing:

npx skills add marketcalls/vectorbt-backtesting-skills -l

Install globally (available across all projects):

npx skills add marketcalls/vectorbt-backtesting-skills -g

Supported AI Coding Agents

Skills are installed via [skills.sh](https://github.com/vercel-labs/skills) which supports 40+ agents. Each agent reads skills from its own directory:

| Agent | Skills Directory | |-------|-----------------| | Claude Code | `.claude/skills/` | | Cursor | `.agents/skills/` | | Codex | `.agents/skills/` | | OpenCode | `.agents/skills/` | | Cline | `.agents/skills/` | | Windsurf | `.agents/skills/` | | GitHub Copilot | `.agents/skills/` | | Gemini CLI | `.agents/skills/` | | Roo Code | `.agents/skills/` | | + 30 more | Auto-detected by `npx skills` |

The `npx skills add` command detects which agents you have installed and places the skill files in the correct paths automatically.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 501 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # VectorBT Backtesting Skills for Agentic Coding Tools
  2. A comprehensive collection of backtesting skills for trading strategies using VectorBT. Works with **40+ AI coding agents** via [skills.sh](https://github.com/vercel-labs/skills) — including Claude Code, Cursor, Codex, OpenCode, Cline, Windsurf, GitHub Copilot, Gemini CLI, Roo Code, and more.
  3. Supports **Indian markets**, **US markets**, and **Crypto markets** with realistic transaction cost modeling, OpenAlgo indicators (100+, TA-Lib available on request), market-specific benchmarking, OpenStatz tearsheets, and robustness testing. Broker-neutral by design — fee models use industry-standard references that can be customized for any broker.
  4. ## Quick Install
  5. Install the skills into your project using [npx skills](https://github.com/vercel-labs/skills). The CLI auto-detects your AI coding agent and installs skills to the correct directory.
  6. ```bash
  7. # GitHub shorthand
  8. npx skills add marketcalls/vectorbt-backtesting-skills
  9. # Full GitHub URL
  10. npx skills add https://github.com/marketcalls/vectorbt-backtesting-skills
  11. ```
  12. Install a specific skill only:
  13. ```bash
  14. npx skills add marketcalls/vectorbt-backtesting-skills -s backtest
  15. npx skills add marketcalls/vectorbt-backtesting-skills -s optimize
  16. npx skills add marketcalls/vectorbt-backtesting-skills -s vectorbt-expert
  17. npx skills add marketcalls/vectorbt-backtesting-skills -s setup
  18. ```
  19. List available skills before installing:
  20. ```bash
  21. npx skills add marketcalls/vectorbt-backtesting-skills -l
  22. ```
  23. Install globally (available across all projects):
  24. ```bash
  25. npx skills add marketcalls/vectorbt-backtesting-skills -g
  26. ```
  27. ### Supported AI Coding Agents
  28. Skills are installed via [skills.sh](https://github.com/vercel-labs/skills) which supports 40+ agents. Each agent reads skills from its own directory:
  29. | Agent | Skills Directory |
  30. |-------|-----------------|
  31. | Claude Code | `.claude/skills/` |
  32. | Cursor | `.agents/skills/` |
  33. | Codex | `.agents/skills/` |
  34. | OpenCode | `.agents/skills/` |
  35. | Cline | `.agents/skills/` |
  36. | Windsurf | `.agents/skills/` |
  37. | GitHub Copilot | `.agents/skills/` |
  38. | Gemini CLI | `.agents/skills/` |
  39. | Roo Code | `.agents/skills/` |
  40. | + 30 more | Auto-detected by `npx skills` |
  41. The `npx skills add` command detects which agents you have installed and places the skill files in the correct paths automatically.
  42. ## Supported Markets
  43. | Market | Data Source | Fee Reference | Default Benchmark |
  44. |--------|------------|---------------|-------------------|
  45. | **India** | OpenAlgo (NSE, BSE, NFO, MCX) | Delivery, Intraday, F&O (4-segment) | NIFTY 50 |
  46. | **US** | yfinance (NYSE, NASDAQ) | Stocks, Options, Futures (per-share + per-contract) | S&P 500 |
  47. | **Crypto** | yfinance / CCXT | Spot, Perpetual Futures (maker/taker) | Bitcoin |
  48. | **Custom** | Any provider via extensible pattern | User-defined | User-defined |
  49. > **Broker-neutral**: Fee models use realistic industry-standard defaults and can be adjusted for any broker by changing the `fees` and `fixed_fees` constants.
  50. ## Capabilities
  51. ### Skills (User-Invocable Commands)
  52. | Command | What It Does |
  53. |---------|-------------|
  54. | `/setup` | Detects OS, creates venv, installs OpenAlgo + all packages (TA-Lib optional), creates `backtesting/` folders, configures `.env` with API keys |
  55. | `/backtest` | Generates a complete backtest script with signals, market-specific fees, benchmark comparison, plain-language report, OpenStatz tearsheet |
  56. | `/optimize` | Parameter grid search with OpenAlgo ta indicators, tqdm progress bars, Plotly heatmaps, best params vs benchmark |
  57. | `/quick-stats` | Inline code block (no file) — fetch data, run EMA crossover, print compact stats + benchmark alpha |
  58. | `/strategy-compare` | Side-by-side comparison of multiple strategies on same symbol, overlaid equity curves |
  59. ### Pre-Built Strategy Templates (12)
  60. | Strategy | Type | Description |
  61. |----------|------|-------------|
  62. | EMA Crossover | Trend | EMA 10/20 crossover |
  63. | RSI | Mean-reversion | RSI(14) oversold/overbought |
  64. | Donchian Channel | Breakout | Channel breakout with shifted levels (no lookahead) |
  65. | Supertrend | Trend | Supertrend with intraday session windows (9:30-15:00, exit 15:15) |
  66. | MACD | Trend + Breakout | MACD zero-line regime + signal-candle breakout |
  67. | SDA2 | Trend | WMA + STDDEV + ATR band system |
  68. | Double Momentum | Momentum | MOM + MOM-of-MOM with next-bar fill |
  69. | Dual Momentum | Rotation | Quarterly ETF rotation (NIFTYBEES vs GOLDBEES) |
  70. | Buy & Hold | Passive | Static multi-asset allocation with FD benchmark |
  71. | RSI Accumulation | Accumulation | Weekly RSI slab-wise buying (5%/10%/20% by RSI level) |
  72. | Walk-Forward | Validation | Rolling train/test optimization with WFE scoring |
  73. | Realistic Costs | Analysis | Same strategy across 5 fee tiers (zero to full delivery) |
  74. ### Knowledge Base (20 Rule Files)
  75. | Category | What's Covered |
  76. |----------|---------------|
  77. | **Data** | OpenAlgo (India), yfinance (US/Global), CCXT (Crypto), custom providers, `.env` + `python-dotenv`, CSV loading, resampling |
  78. | **Indicators** | OpenAlgo ta by default - 100+ indicators (EMA, SMA, RSI, MACD, BBands, ATR, ADX, STDDEV, MOM, Supertrend, Donchian, Ichimoku, HMA, KAMA, ALMA, ZLEMA, VWMA, oscillators, statistical, hybrid). TA-Lib only if explicitly requested |
  79. | **Signals** | `ta.exrem()` signal cleaning, `ta.crossover()`, `ta.crossunder()`, `ta.flip()` regime detection |
  80. | **Simulation** | `from_signals`, `from_orders`, `from_holding`, long/short/both directions |
  81. | **Sizing** | Percent, Value, TargetPercent, whole shares (`min_size=1`), futures lot sizes, fractional crypto |
  82. | **Costs** | **India**: 4-segment model (Delivery 0.111%, Intraday 0.0225%, Futures 0.018%, Options 0.098%). **US**: Per-share + per-contract model (Stocks ~0.01%, Options ~0.2%, Futures ~0.001%). **Crypto**: Maker/taker model (Spot 0.1%, Futures 0.02%/0.05%, funding rates). All customizable. |
  83. | **Futures** | SEBI revised lot sizes (Dec 2025): NIFTY=65, BANKNIFTY=30, FINNIFTY=60. US: E-mini/Micro contract specs |
  84. | **Risk** | Stop loss, take profit, trailing stop (`sl_trail`) |
  85. | **Optimization** | Loop-based (OpenAlgo ta / TA-Lib compliant) + broadcasting (vbt.MA exception for parameter sweeps) |
  86. | **Benchmarking** | India: NIFTY 50 via OpenAlgo. US: S&P 500 (`^GSPC`). Crypto: Bitcoin (`BTC-USD`). Strategy vs Benchmark table always produced |
  87. | **Reporting** | Plain-language backtest explanation for normal traders. OpenStatz HTML tearsheets with 30+ metrics, Monte Carlo simulations |
  88. | **Plotting** | Plotly dark theme, candlestick with `xaxis type="category"` (no weekend gaps), VectorBT 7-panel plot pack |
  89. | **Validation** | Walk-forward analysis (WFE ratio), robustness testing (Monte Carlo trade shuffle, noise injection, parameter sensitivity, entry/exit delay, cross-symbol validation) |
  90. | **Safety** | 10 common pitfalls with prevention, checklist before going live |
  91. ## Prerequisites
  92. ### 1. AI Coding Agent
  93. Install any supported AI coding agent. For example:
  94. - [Claude Code](https://docs.anthropic.com/en/docs/claude-code) — `npm install -g @anthropic-ai/claude-code`
  95. - [Cursor](https://cursor.com) — Desktop IDE with built-in AI
  96. - [Codex](https://github.com/openai/codex) — `npm install -g @openai/codex`
  97. - [OpenCode](https://github.com/opencode-ai/opencode) — `go install github.com/opencode-ai/opencode@latest`
  98. - [Cline](https://github.com/cline/cline) — VS Code extension
  99. - [Windsurf](https://windsurf.com) — Desktop IDE with AI
  100. - Or any of the [40+ supported agents](https://github.com/vercel-labs/skills)
  101. Then install the skills:
  102. ```bash
  103. npx skills add marketcalls/vectorbt-backtesting-skills
  104. ```
  105. ### 2. Data Source Setup
  106. **Indian Markets** — requires [OpenAlgo](https://github.com/marketcalls/openalgo):
  107. ```bash
  108. git clone https://github.com/marketcalls/openalgo.git
  109. cd openalgo
  110. pip install -r requirements.txt
  111. python app.py
  112. ```
  113. OpenAlgo runs locally at `http://127.0.0.1:5000`. You need a broker account connected via OpenAlgo and an API key from the dashboard. See [OpenAlgo documentation](https://docs.openalgo.in/).
  114. **US Markets** — no setup needed. Uses yfinance (public Yahoo Finance data).
  115. **Crypto Markets** — no setup needed for public data (yfinance or CCXT). Exchange API keys are optional (only for private endpoints).
  116. ### 3. Python Environment Setup
  117. Use the `/setup` skill for automated setup, or manually:
  118. ```bash
  119. python -m venv venv
  120. source venv/bin/activate # Linux/Mac
  121. # venv\Scripts\activate # Windows
  122. # Install Python packages (OpenAlgo ta is the default indicator library - no C library needed)
  123. pip install openalgo vectorbt plotly anywidget nbformat pandas numpy yfinance python-dotenv tqdm scipy numba ipywidgets openstatz ccxt
  124. # Optional: only if you want to be able to request TA-Lib explicitly in a backtest
  125. brew install ta-lib # macOS
  126. # sudo apt install libta-lib-dev # Linux
  127. pip install ta-lib
  128. ```
  129. ### 4. Configure API Keys
  130. ```bash
  131. cp .env.sample .env
  132. # Edit .env with your API keys
  133. ```
  134. ## Usage Examples
  135. ### `/setup` - Environment Setup
  136. Detects OS, creates venv, installs dependencies, creates folder structure, and collects API keys into `.env`.
  137. ```
  138. /setup
  139. /setup python3.12
  140. ```
  141. ### `/backtest` - Quick Backtest
  142. Create a complete backtest script with market-specific fees, benchmark comparison, plain-language report, and OpenStatz tearsheet.
  143. ```
  144. # Indian Markets
  145. /backtest ema-crossover SBIN NSE D
  146. /backtest rsi RELIANCE NSE D
  147. /backtest supertrend NIFTY NFO 5m
  148. # US Markets
  149. /backtest ema-crossover AAPL
  150. /backtest rsi MSFT
  151. # Crypto Markets
  152. /backtest ema-crossover BTC-USD
  153. ```
  154. ### `/optimize` - Parameter Optimization
  155. Optimize strategy parameters, generate Plotly heatmaps, and compare best parameters vs benchmark.
  156. ```
  157. /optimize ema-crossover SBIN NSE D
  158. /optimize rsi AAPL
  159. ```
  160. ### `/quick-stats` - Inline Stats
  161. Print key backtest stats with benchmark comparison without creating a file.
  162. ```
  163. /quick-stats RELIANCE
  164. /quick-stats AAPL
  165. /quick-stats BTC-USD
  166. ```
  167. ### `/strategy-compare` - Compare Strategies
  168. Compare multiple strategies side-by-side with benchmark.
  169. ```
  170. /strategy-compare RELIANCE ema-crossover rsi donchian
  171. /strategy-compare AAPL ema-crossover rsi macd
  172. ```
  173. ## Key Features
  174. ### Multi-Market Transaction Costs
  175. Realistic fee models for each market, auto-selected based on the asset. All fee constants are configurable — adjust for your broker by changing the `fees` and `fixed_fees` values.
  176. #### Indian Market Fees
  177. | Segment | `fees` | `fixed_fees` |
  178. |---------|--------|-------------|
  179. | Delivery Equity | 0.00111 (0.111%) | Rs 20/order |
  180. | Intraday Equity | 0.000225 (0.0225%) | Rs 20/order |
  181. | F&O Futures | 0.00018 (0.018%) | Rs 20/order |
  182. | F&O Options | 0.00098 (0.098%) | Rs 20/order |
  183. #### US Market Fees
  184. | Segment | `fees` | `fixed_fees` |
  185. |---------|--------|-------------|
  186. | Stocks (Pro/Fixed) | 0.0001 (0.01%) | $1.00/order |
  187. | Stocks (Commission-Free) | 0.00001 (~0.001%) | $0 |
  188. | Options | 0.002 (0.2%) | $0.65/contract |
  189. | E-mini Futures (ES, NQ) | 0.000009 (~0.001%) | $2.25/contract |
  190. | Micro Futures (MES, MNQ) | 0.00002 (~0.002%) | $0.55/contract |
  191. #### Crypto Market Fees
  192. | Segment | `fees` | `fixed_fees` |
  193. |---------|--------|-------------|
  194. | Spot (Base) | 0.001 (0.1%) | $0 |
  195. | Spot (Discounted) | 0.00075 (0.075%) | $0 |
  196. | USDT-M Futures (Taker) | 0.0005 (0.05%) | $0 |
  197. | USDT-M Futures (Maker) | 0.0002 (0.02%) | $0 |
  198. | COIN-M Futures (Taker) | 0.0005 (0.05%) | $0 |
  199. > **Using a different broker?** Simply override the fee constants in your backtest script. The rule files include detailed breakdowns (STT, exchange fees, regulatory fees, clearing fees) so you can recalculate for any broker.
  200. ### OpenAlgo ta Indicators (Default)
  201. All strategies use `openalgo.ta` for technical indicators by default - 100+ indicators across trend, momentum, volatility, volume, oscillators, statistical, and hybrid categories. VectorBT built-in indicators are never used.
  202. ```python
  203. from openalgo import ta
  204. ema_fast = ta.ema(close, 10)
  205. st_line, st_direction = ta.supertrend(high, low, close, period=10, multiplier=3.0)
  206. entries = ta.exrem(buy_raw.fillna(False), sell_raw.fillna(False))
  207. ```
  208. Specialty indicators with no TA-Lib equivalent (Supertrend, Donchian, Ichimoku, HMA, KAMA, ALMA, ZLEMA, VWMA) plus signal utilities (`exrem`, `crossover`, `crossunder`, `flip`) always come from `openalgo.ta`.
  209. ### TA-Lib (Opt-In Only)
  210. Only used when the user explicitly asks for "talib"/"TA-Lib" in their request:
  211. ```python
  212. import talib as tl
  213. ema_fast = pd.Series(tl.EMA(close.values, timeperiod=10), index=close.index)
  214. ```
  215. ### Market-Specific Benchmarks
  216. | Market | Default Benchmark | Source |
  217. |--------|-------------------|--------|
  218. | India | NIFTY 50 | OpenAlgo (`NSE_INDEX`) |
  219. | US | S&P 500 | yfinance (`^GSPC` or `SPY`) |
  220. | Crypto | Bitcoin | yfinance (`BTC-USD`) |
  221. Every backtest produces a Strategy vs Benchmark comparison table.
  222. ### OpenStatz Tearsheets
  223. A modern interactive tearsheet with 30+ metrics, drawdown analysis, rolling statistics, monthly heatmaps, and Monte Carlo simulations. `ostz.dashboard(...)` renders the same interactive dashboard as `openstatz serve` into a single self-contained offline HTML file - no server, no `[app]` extra, no network. OpenStatz replaces QuantStats project-wide and keeps a numerical-parity contract on its metrics.
  224. ```python
  225. import openstatz as ostz # alias as ostz, not os - avoids shadowing the stdlib os module
  226. # dashboard() needs the benchmark as a returns Series (not a ticker string)
  227. benchmark = ostz.providers.download_returns("^NSEI").reindex(pf.returns().index).fillna(0)
  228. ostz.dashboard(pf.returns(), benchmark=benchmark, output="tearsheet.html")
  229. ```
  230. ### Plain-Language Report Explanation
  231. Every backtest explains results so normal traders can understand:
  232. ```
  233. * Total Return: Your strategy made 45.23% while NIFTY 50 made 32.10%
  234. -> BEAT the market by 13.13%
  235. * Max Drawdown: -12.34% - the biggest drop from peak
  236. -> On Rs 10,00,000 capital, worst temporary loss = Rs 1,23,400
  237. * Sharpe Ratio: 1.45 (return per unit of risk, >1 decent, >2 excellent)
  238. ```
  239. ### Extensible Data Providers
  240. Built-in support for OpenAlgo, yfinance, and CCXT. Add custom providers (Alpaca, Twelve Data, etc.) following the pattern in `data-fetching.md`. All API keys stored in `.env` via `python-dotenv`.
  241. ### SEBI Revised Lot Sizes (Effective 31 Dec 2025)
  242. | Index | Lot Size | Exchange |
  243. |-------|----------|----------|
  244. | Nifty 50 | 65 | NFO |
  245. | Nifty Bank | 30 | NFO |
  246. | Nifty Financial Services | 60 | NFO |
  247. | Nifty Midcap Select | 120 | NFO |
  248. | Nifty Next 50 | 25 | NFO |
  249. | BSE Sensex | 20 | BFO |
  250. | BSE Bankex | 30 | BFO |
  251. | BSE Sensex 50 | 70 | BFO |
  252. ### Backtesting Folder Structure
  253. Strategy name = folder name. Symbol name = file prefix. Each strategy folder is self-contained.
  254. ```
  255. backtesting/
  256. ├── ema_crossover/
  257. │ ├── .env
  258. │ ├── SBIN_ema_crossover_backtest.py
  259. │ ├── SBIN_ema_crossover_trades.csv
  260. │ ├── SBIN_tearsheet.html
  261. │ ├── AAPL_ema_crossover_backtest.py
  262. │ └── AAPL_ema_crossover_trades.csv
  263. ├── rsi/
  264. │ ├── .env
  265. │ ├── INFY_rsi_backtest.py
  266. │ └── ...
  267. ├── supertrend/
  268. │ └── ...
  269. └── custom/
  270. └── ...
  271. ```
  272. ## Project Structure
  273. ```
  274. .
  275. ├── .claude/
  276. │ └── skills/
  277. │ ├── setup/ # /setup - Environment setup
  278. │ │ └── SKILL.md
  279. │ ├── backtest/ # /backtest - Quick backtest
  280. │ │ └── SKILL.md
  281. │ ├── optimize/ # /optimize - Parameter optimization
  282. │ │ └── SKILL.md
  283. │ ├── quick-stats/ # /quick-stats - Inline stats
  284. │ │ └── SKILL.md
  285. │ ├── strategy-compare/ # /strategy-compare - Compare strategies
  286. │ │ └── SKILL.md
  287. │ └── vectorbt-expert/ # Knowledge base (auto-loaded)
  288. │ ├── SKILL.md # Main skill (modular reference hub)
  289. │ └── rules/ # 20 modular rule files
  290. │ ├── data-fetching.md
  291. │ ├── simulation-modes.md
  292. │ ├── position-sizing.md
  293. │ ├── indicators-signals.md
  294. │ ├── openalgo-ta-helpers.md
  295. │ ├── stop-loss-take-profit.md
  296. │ ├── parameter-optimization.md
  297. │ ├── performance-analysis.md
  298. │ ├── plotting.md
  299. │ ├── indian-market-costs.md
  300. │ ├── us-market-costs.md
  301. │ ├── crypto-market-costs.md
  302. │ ├── futures-backtesting.md
  303. │ ├── long-short-trading.md
  304. │ ├── csv-data-resampling.md
  305. │ ├── walk-forward.md
  306. │ ├── robustness-testing.md
  307. │ ├── pitfalls.md
  308. │ ├── strategy-catalog.md
  309. │ ├── openstatz-tearsheet.md
  310. │ └── assets/ # Production-ready templates
  311. │ ├── ema_crossover/backtest.py
  312. │ ├── rsi/backtest.py
  313. │ ├── donchian/backtest.py
  314. │ ├── supertrend/backtest.py
  315. │ ├── macd/backtest.py
  316. │ ├── sda2/backtest.py
  317. │ ├── momentum/backtest.py
  318. │ ├── dual_momentum/backtest.py
  319. │ ├── buy_hold/backtest.py
  320. │ ├── rsi_accumulation/backtest.py
  321. │ ├── walk_forward/template.py
  322. │ └── realistic_costs/template.py
  323. ├── .env.sample # Environment template (copy to .env)
  324. ├── backtesting/ # Generated backtest scripts (per strategy)
  325. │ ├── ema_crossover/
  326. │ ├── rsi/
  327. │ ├── donchian/
  328. │ ├── supertrend/
  329. │ ├── macd/
  330. │ ├── sda2/
  331. │ ├── momentum/
  332. │ ├── dual_momentum/
  333. │ ├── buy_hold/
  334. │ ├── rsi_accumulation/
  335. │ ├── walk_forward/
  336. │ └── custom/
  337. └── README.md
  338. ```
  339. ## Rule Files Reference
  340. | Rule File | Description |
  341. |-----------|-------------|
  342. | `data-fetching.md` | OpenAlgo (India), yfinance (US), CCXT (Crypto), custom providers, `.env` setup |
  343. | `simulation-modes.md` | from_signals, from_orders, from_holding, direction types |
  344. | `position-sizing.md` | Amount/Value/Percent/TargetPercent sizing, whole shares |
  345. | `indicators-signals.md` | OpenAlgo ta indicator reference (default), TA-Lib opt-in, signal generation |
  346. | `openalgo-ta-helpers.md` | Complete OpenAlgo ta catalog (100+ indicators): exrem, crossover, Supertrend, Donchian, Ichimoku, MAs |
  347. | `stop-loss-take-profit.md` | Fixed SL, TP, trailing stop configurations |
  348. | `parameter-optimization.md` | Broadcasting and loop-based optimization, heatmaps |
  349. | `performance-analysis.md` | Stats, metrics, benchmark comparison, CAGR calculation |
  350. | `plotting.md` | Candlestick (category x-axis), VectorBT plots, custom Plotly |
  351. | `indian-market-costs.md` | Indian market fee model — delivery, intraday, F&O (4-segment) |
  352. | `us-market-costs.md` | US market fee model — stocks, options, futures (per-share + per-contract) |
  353. | `crypto-market-costs.md` | Crypto fee model — spot, perpetual futures, funding rates (maker/taker) |
  354. | `futures-backtesting.md` | SEBI revised lot sizes (Dec 2025), US contract specs, value sizing |
  355. | `long-short-trading.md` | Simultaneous long/short, direction comparison |
  356. | `csv-data-resampling.md` | Loading CSV data, resampling with Indian market alignment |
  357. | `walk-forward.md` | Walk-forward analysis, WFE ratio, rolling optimization |
  358. | `robustness-testing.md` | Monte Carlo, noise test, parameter sensitivity, delay test |
  359. | `pitfalls.md` | 10 common mistakes and checklist before going live |
  360. | `strategy-catalog.md` | All strategy types with code snippets and asset references |
  361. | `openstatz-tearsheet.md` | OpenStatz interactive offline dashboard, 30+ metrics, Monte Carlo (replaces QuantStats) |
  362. ## Data Sources
  363. | Source | Use Case | Tickers/Codes | API Key Required |
  364. |--------|----------|---------------|------------------|
  365. | OpenAlgo | Indian markets (primary) | NSE, BSE, NFO, BFO, CDS, MCX, NSE_INDEX, BSE_INDEX | Yes (`OPENALGO_API_KEY`) |
  366. | yfinance | US markets, global, crypto | `AAPL`, `SPY`, `^GSPC`, `^NSEI`, `BTC-USD`, `ETH-USD` | No |
  367. | CCXT | Crypto exchanges | `BTC/USDT`, `ETH/USDT` (higher resolution data) | Optional |
  368. | Custom | Any provider | User-defined | User-defined |
  369. ## Configuration
  370. Copy the `.env.sample` and fill in your API keys:
  371. ```bash
  372. cp .env.sample .env
  373. ```
  374. The `.env` file supports:
  375. ```
  376. # Indian Markets (OpenAlgo)
  377. OPENALGO_API_KEY=your_openalgo_api_key_here
  378. OPENALGO_HOST=http://127.0.0.1:5000
  379. # Crypto Markets (CCXT) — Optional
  380. CRYPTO_API_KEY=
  381. CRYPTO_SECRET_KEY=
  382. # Custom Data Providers - add your own keys
  383. # ALPACA_API_KEY=
  384. # TWELVEDATA_API_KEY=
  385. ```
  386. US market data via yfinance does not require an API key.
  387. ## License
  388. MIT

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.