Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Backtest

ASecurity

Quick backtest a strategy on a symbol. Creates a complete .py script with data fetch, signals, backtest, stats, and plots.

3 stars
0 votes
0 copies
0 views
Added 9/7/2026
businessgobashtestingapi

Works with

cliapi

Security Analysis

A100/100

Scanned 9/7/2026

Install to Claude Code

$npx -y skills add levalencia/agent-god-mode --skill backtest --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Backtest?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Backtest
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/levalencia-backtest/badge)](https://www.skillsdirectory.com/skills/levalencia-backtest)

More formats (shields.io, HTML) on the badges page.

Download with Pro
Files
SKILL.md
---
name: backtest
description: Quick backtest a strategy on a symbol. Creates a complete .py script with data fetch, signals, backtest, stats, and plots.
argument-hint: "[strategy] [symbol] [exchange] [interval]"
allowed-tools: Read, Write, Edit, Bash, Glob, Grep
---

Create a complete VectorBT backtest script for the user.

## Arguments

Parse `$ARGUMENTS` as: strategy symbol exchange interval

- `$0` = strategy name (e.g., ema-crossover, rsi, donchian, supertrend, macd, sda2, momentum)
- `$1` = symbol (e.g., SBIN, RELIANCE, NIFTY). Default: SBIN
- `$2` = exchange (e.g., NSE, NFO). Default: NSE
- `$3` = interval (e.g., D, 1h, 5m). Default: D

If no arguments, ask the user which strategy they want.

## Instructions

1. Read the vectorbt-expert skill rules for reference patterns
2. Create `backtesting/{strategy_name}/` directory if it doesn't exist (on-demand)
3. Create a `.py` file in `backtesting/{strategy_name}/` named `{symbol}_{strategy}_backtest.py`
4. Use the matching template from `rules/assets/{strategy}/backtest.py` as the starting point
5. The script must:
   - Load `.env` from the project root using `find_dotenv()` (walks up from script dir automatically)
   - Fetch data via `client.history()` from OpenAlgo
   - If user provides a DuckDB path, load data directly via `duckdb.connect(path, read_only=True)` instead of OpenAlgo API. Auto-detect format: Historify (`market_data` table, epoch timestamps) vs custom (`ohlcv` table, date+time). See vectorbt-expert `rules/duckdb-data.md`.
   - If `openalgo.ta` is not importable (standalone DuckDB), use inline `exrem()` fallback.
   - **Use TA-Lib for ALL indicators** (EMA, SMA, RSI, MACD, BBands, ATR, ADX, STDDEV, MOM)
   - **Use OpenAlgo ta** for specialty indicators (Supertrend, Donchian, Ichimoku, HMA, KAMA, ALMA)
   - Use `ta.exrem()` to clean duplicate signals (always `.fillna(False)` before exrem)
   - Run `vbt.Portfolio.from_signals()` with `min_size=1, size_granularity=1`
   - **Indian delivery fees**: `fees=0.00111, fixed_fees=20` for delivery equity
   - Fetch NIFTY benchmark via OpenAlgo (`symbol="NIFTY", exchange="NSE_INDEX"`)
   - Print full `pf.stats()`
   - **Print Strategy vs Benchmark comparison table** (Total Return, Sharpe, Sortino, Max DD, Win Rate, Trades, Profit Factor)
   - **Explain the backtest report** in plain language for normal traders
   - Generate QuantStats HTML tearsheet if `quantstats` is available
   - Plot equity curve + drawdown using Plotly (`template="plotly_dark"`)
   - Export trades to CSV
5. Never use icons/emojis in code or logger output
6. For futures symbols (NIFTY, BANKNIFTY), use lot-size-aware sizing:
   - NIFTY: `min_size=65, size_granularity=65` (effective 31 Dec 2025)
   - BANKNIFTY: `min_size=30, size_granularity=30`
   - Use `fees=0.00018, fixed_fees=20` for F&O futures

## Available Strategies

| Strategy | Keyword | Template |
|----------|---------|----------|
| EMA Crossover | `ema-crossover` | `assets/ema_crossover/backtest.py` |
| RSI | `rsi` | `assets/rsi/backtest.py` |
| Donchian Channel | `donchian` | `assets/donchian/backtest.py` |
| Supertrend | `supertrend` | `assets/supertrend/backtest.py` |
| MACD Breakout | `macd` | `assets/macd/backtest.py` |
| SDA2 | `sda2` | `assets/sda2/backtest.py` |
| Momentum | `momentum` | `assets/momentum/backtest.py` |
| Dual Momentum | `dual-momentum` | `assets/dual_momentum/backtest.py` |
| Buy & Hold | `buy-hold` | `assets/buy_hold/backtest.py` |
| RSI Accumulation | `rsi-accumulation` | `assets/rsi_accumulation/backtest.py` |

## Benchmark Rules

- Default: NIFTY 50 via OpenAlgo (`symbol="NIFTY", exchange="NSE_INDEX"`)
- If user specifies a different benchmark, use that instead
- For yfinance: use `^NSEI` for India, `^GSPC` (S&P 500) for US markets
- Always compare: Total Return, Sharpe, Sortino, Max Drawdown

## Example Usage

`/backtest ema-crossover RELIANCE NSE D`
`/backtest rsi SBIN`
`/backtest supertrend NIFTY NFO 5m`

Attribution

levalencialevalencia
View sourceMore from levalencia →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Solution Architect

Designs system architecture, component specifications, and technical integration strategy. Use when: designing solutions, system architecture, technology stack, or integration approaches.

192 votes

Akorchak:Venture Assessment

Generate a comprehensive VC investment assessment report for a company

72 votes

Stock Analysis

Analyze stocks and cryptocurrencies using Yahoo Finance data. Supports portfolio management (create, add, remove assets), crypto analysis (Top 20 by market cap), and periodic performance reports (daily/weekly/monthly/quarterly/yearly). 8 analysis dimensions for stocks, 3 for crypto. Use for stock analysis, portfolio tracking, earnings reactions, or crypto monitoring.

6511 votes

Just Fucking Cancel

Find and cancel unwanted subscriptions by analyzing bank transactions. Detects recurring charges, calculates annual waste, and helps you cancel with direct URLs and browser automation. Use when: 'cancel subscriptions', 'audit subscriptions', 'find recurring charges', 'what am I paying for', 'save money', 'subscription cleanup', 'stop wasting money'. Supports CSV import (Apple Card, Chase, Amex, Citi, Bank of America, Capital One, Mint, Copilot) OR Plaid API for automatic transaction pull. Out...

6511 votes

Telegram Compose

Compose rich, readable Telegram messages using HTML formatting via direct Telegram API. Use when: (1) Sending any Telegram message beyond a simple one-line reply, (2) Creating structured messages with sections, lists, or status updates, (3) Need formatting unavailable via Clawdbot's Markdown conversion (underline, spoilers, expandable blockquotes, user mentions by ID), (4) Sending alerts, reports, summaries, or notifications to Telegram, (5) Want professional, scannable message formatting wit...

6511 votes
View all in business →