Llmquant Strategies
LLMQuant/skills
Router skill for LLMQuant hedge-fund and PM strategy workflows.
Event-driven backtesting with bar-by-bar execution, complex order types, multiple analyzers, and custom indicators
$ npx skills add agiprolabs/claude-trading-skills --skill backtrader -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install agiprolabs/claude-trading-skills backtrader --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/agiprolabs/claude-trading-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/backtrader .claude/skills/backtrader && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "backtrader" agent skill from https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/backtrader into .claude/skills/backtrader/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "backtrader", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/backtraderType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add agiprolabs/claude-trading-skills --skill backtrader -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install agiprolabs/claude-trading-skills backtrader --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/agiprolabs/claude-trading-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/backtrader .agents/skills/backtrader && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "backtrader" agent skill from https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/backtrader into .agents/skills/backtrader/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "backtrader", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add agiprolabs/claude-trading-skills --skill backtrader -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install agiprolabs/claude-trading-skills backtrader --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/agiprolabs/claude-trading-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/backtrader .cursor/skills/backtrader && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "backtrader" agent skill from https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/backtrader into .cursor/skills/backtrader/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "backtrader", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/agiprolabs/claude-trading-skills.git --path skills/backtrader--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add agiprolabs/claude-trading-skills --skill backtrader -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install agiprolabs/claude-trading-skills backtrader --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/agiprolabs/claude-trading-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/backtrader .gemini/skills/backtrader && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "backtrader" agent skill from https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/backtrader into .gemini/skills/backtrader/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "backtrader", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install agiprolabs/claude-trading-skills backtraderInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add agiprolabs/claude-trading-skills --skill backtrader -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/agiprolabs/claude-trading-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/backtrader .github/skills/backtrader && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "backtrader" agent skill from https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/backtrader into .github/skills/backtrader/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "backtrader", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add agiprolabs/claude-trading-skills --skill backtrader -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install agiprolabs/claude-trading-skills backtrader --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/agiprolabs/claude-trading-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/backtrader .opencode/skills/backtrader && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "backtrader" agent skill from https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/backtrader into .opencode/skills/backtrader/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "backtrader", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
backtraderEvent-driven backtesting with bar-by-bar execution, complex order types, multiple analyzers, and custom indicators
Backtrader is an agent skill from agiprolabs/claude-trading-skills. Event-driven backtesting with bar-by-bar execution, complex order types, multiple analyzers, and custom indicators
Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including scripts and reference files (for example `references/api_guide.md`, `references/strategy_patterns.md` and `scripts/backtest_strategy.py`).
It sits in Backend & APIs, covering Event-driven systems and Trading and backtesting. The repository describes itself as: 68 trading, DeFi, and quantitative finance Agent Skills. Works with Claude Code, Cursor, Codex, Gemini CLI, and 30+ other tools. The licence is MIT.
5 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 981e1d7. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships 2 files in scripts/ (Python), which the agent can run.
Shell commands in SKILL.md call:
pythonuvFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use uv, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Backtrader loads about 2.4k tokens when it runs, and up to ~6.5k if it reads all its reference files. Until then it costs about 31 tokens; SKILL.md has 626 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from agiprolabs/claude-trading-skills at commit 981e1d7, republished under its MIT licence (© agiprolabs). 626 words, ~2,444 tokens.
.claude/skills/backtrader/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.Backtrader is a Python event-driven backtesting framework that processes data bar-by-bar, simulating realistic execution with a built-in broker, order management, and position tracking. Unlike vectorized frameworks (vectorbt, pandas), backtrader walks through history one bar at a time, firing callbacks that let you implement complex order logic that depends on previous fills, partial executions, and conditional brackets.
| Aspect | Backtrader (event-driven) | vectorbt (vectorized) |
|---|---|---|
| Execution model | Bar-by-bar callbacks | Whole-array operations |
| Speed | Slower (Python loop) | Fast (NumPy/Numba) |
| Order types | Market, limit, stop, stop-limit, bracket, OCO | Market only (native) |
| Realism | Built-in broker with commission, slippage, margin | Manual slippage modeling |
| Multi-timeframe | Native resampledata | Manual alignment |
| Best for | Complex strategies, bracket orders, portfolio | Fast parameter sweeps, simple signals |
Use backtrader when you need:
Use vectorbt when you need:
Backtrader has five core objects that interact through an event loop:
The central orchestrator. You add strategies, data feeds, analyzers, and sizers to Cerebro, then call run().
import backtrader as bt
cerebro = bt.Cerebro()
cerebro.addstrategy(MyStrategy, fast_period=10, slow_period=30)
cerebro.adddata(data_feed)
cerebro.broker.setcash(100_000)
cerebro.broker.setcommission(commission=0.003) # 0.3%
cerebro.addanalyzer(bt.analyzers.SharpeRatio, _name="sharpe")
cerebro.addanalyzer(bt.analyzers.DrawDown, _name="drawdown")
cerebro.run()A Strategy subclass contains all trading logic. Key methods:
__init__() — Define indicators. Runs once before backtesting starts.next() — Called on every bar. Place orders here.notify_order(order) — Called when order status changes (submitted, accepted, completed, canceled, margin, expired).notify_trade(trade) — Called when a trade opens or closes. Access P&L here.class EMACrossover(bt.Strategy):
params = (
("fast_period", 10),
("slow_period", 30),
)
def __init__(self) -> None:
self.ema_fast = bt.ind.EMA(period=self.p.fast_period)
self.ema_slow = bt.ind.EMA(period=self.p.slow_period)
self.crossover = bt.ind.CrossOver(self.ema_fast, self.ema_slow)
def next(self) -> None:
if not self.position:
if self.crossover > 0:
self.buy()
elif self.crossover < 0:
self.close()Backtrader data feeds provide OHLCV lines. The most common approach is loading from a pandas DataFrame:
import pandas as pd
df = pd.DataFrame({
"open": [...], "high": [...], "low": [...],
"close": [...], "volume": [...],
}, index=pd.DatetimeIndex([...]))
data = bt.feeds.PandasData(dataname=df)
cerebro.adddata(data)For CSV files:
data = bt.feeds.GenericCSVData(
dataname="ohlcv.csv",
dtformat="%Y-%m-%d",
openinterest=-1, # no open interest column
)The built-in broker simulates order execution with configurable cash, commission, and slippage.
cerebro.broker.setcash(100_000)
cerebro.broker.setcommission(commission=0.003) # 0.3% per trade
# Cheat-on-open: execute at the open of the signal bar (avoids lookahead)
cerebro.broker.set_coo(True)Analyzers compute performance metrics after the backtest completes.
cerebro.addanalyzer(bt.analyzers.SharpeRatio, _name="sharpe",
riskfreerate=0.0, annualize=True, timeframe=bt.TimeFrame.Days)
cerebro.addanalyzer(bt.analyzers.DrawDown, _name="drawdown")
cerebro.addanalyzer(bt.analyzers.TradeAnalyzer, _name="trades")
cerebro.addanalyzer(bt.analyzers.Returns, _name="returns")
results = cerebro.run()
strat = results[0]
sharpe = strat.analyzers.sharpe.get_analysis()
dd = strat.analyzers.drawdown.get_analysis()
trades = strat.analyzers.trades.get_analysis()Backtrader supports complex order types critical for realistic crypto backtesting.
self.buy() # market buy
self.sell() # market sell
self.close() # close current positionself.buy(exectype=bt.Order.Limit, price=95.0)
self.sell(exectype=bt.Order.Limit, price=105.0)Triggers a market order when price reaches the stop level:
self.sell(exectype=bt.Order.Stop, price=90.0) # stop lossTriggers a limit order when price reaches the stop level:
self.buy(exectype=bt.Order.StopLimit, price=100.0, plimit=101.0)Entry + stop loss + take profit as an atomic unit. If the stop fills, the take profit is canceled (and vice versa).
self.buy_bracket(
price=100.0, # entry limit
stopprice=95.0, # stop loss
limitprice=110.0, # take profit
exectype=bt.Order.Limit,
stopexec=bt.Order.Stop,
limitexec=bt.Order.Limit,
)See references/strategy_patterns.md for bracket order patterns with ATR-based stops.
Sizers determine how many units to buy/sell per order.
# Fixed size
cerebro.addsizer(bt.sizers.FixedSize, stake=100)
# Percent of portfolio
cerebro.addsizer(bt.sizers.PercentSizer, percents=95)
# All available cash
cerebro.addsizer(bt.sizers.AllInSizer, percents=95)Custom sizer:
class RiskSizer(bt.Sizer):
params = (("risk_pct", 0.02),)
def _getsizing(self, comminfo, cash, data, isbuy):
risk_amount = cash * self.p.risk_pct
atr = self.strategy.atr[0]
if atr <= 0:
return 0
size = risk_amount / atr
return int(size)Crypto trades around the clock. When using daily bars, there are no weekends to skip. Set the session times or use sessionstart/sessionend if analyzing specific windows.
DEX swaps on Solana typically cost 0.25-0.30% per trade. Set commission accordingly:
cerebro.broker.setcommission(commission=0.003) # 0.3% round trip per sideCrypto allows fractional units. Backtrader supports this natively -- no special config needed.
For realistic simulation, enable cheat-on-open and add slippage:
cerebro.broker.set_coo(True)
cerebro.broker.set_slippage_perc(0.001) # 0.1% slippageCrypto OHLCV data often has extreme wicks. Use ATR-based stops rather than fixed percentage stops to adapt to volatility.
Backtrader can resample data to multiple timeframes within a single strategy:
data_1h = bt.feeds.PandasData(dataname=df_1h)
cerebro.adddata(data_1h)
# Resample 1h to daily
cerebro.resampledata(data_1h, timeframe=bt.TimeFrame.Days, compression=1)Access in strategy:
def __init__(self):
self.ema_1h = bt.ind.EMA(self.datas[0], period=20) # hourly
self.ema_daily = bt.ind.EMA(self.datas[1], period=20) # dailyclass SpreadIndicator(bt.Indicator):
lines = ("spread", "zscore",)
params = (("period", 20),)
def __init__(self):
mean = bt.ind.SMA(self.data, period=self.p.period)
std = bt.ind.StdDev(self.data, period=self.p.period)
self.lines.spread = self.data - mean
self.lines.zscore = self.lines.spread / stdBacktrader includes matplotlib-based plotting:
cerebro.plot(style="candlestick", volume=True)For headless environments, save to file:
import matplotlib
matplotlib.use("Agg")
figs = cerebro.plot(style="candlestick")
figs[0][0].savefig("backtest_result.png", dpi=150)references/api_guide.md for adding extra lines.notify_trade and plot with the visualization skill.position-sizing skill for Kelly or volatility-targeting sizers.risk-management skill as strategy filters.slippage-modeling skill to configure set_slippage_perc.references/api_guide.md — Cerebro, Strategy, Broker, Analyzer, Data Feed API referencereferences/strategy_patterns.md — Reusable strategy patterns: crossover, mean reversion, multi-timeframe, custom indicatorsscripts/backtest_strategy.py — Complete EMA crossover backtest with analyzers and synthetic datascripts/bracket_orders.py — Bracket order demonstration with RSI entry and ATR-based stopsuv pip install backtrader pandas numpy matplotlib
python scripts/backtest_strategy.py --demo
python scripts/bracket_orders.py --demo© agiprolabs, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 4 other files (scripts, references) in skills/backtrader of agiprolabs/claude-trading-skills.
Open the folder on GitHubat commit 981e1d7
Backtrader next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Backtrader this skillagiprolabs/claude-trading-skills | 410 | — | ~2.4k | Automated safety check: Pass | MIT | |
| Llmquant StrategiesLLMQuant/skills | 229 | 1 repos | ~559 | Automated safety check: Pass | MIT | |
| Cryptofeed2025Emma/vibe-coding-cn | 23k | 1 repos | ~1.6k | Automated safety check: Pass | MIT | |
| Backtestinggauss314/skills | 246 | — | ~2.4k | Automated safety check: Pass | MIT | |
| Polymarket2025Emma/vibe-coding-cn | 23k | 1 repos | ~1.6k | Automated safety check: Pass | MIT | |
| Signalsalsk1992/CloddsBot | 2.9k | — | ~720 | Automated safety check: Pass | MIT |
LLMQuant/skills
Router skill for LLMQuant hedge-fund and PM strategy workflows.
2025Emma/vibe-coding-cn
Cryptofeed - Real-time cryptocurrency market data feeds from 40+ exchanges.
gauss314/skills
Academic backtesting framework for quantitative research. An agent skill from gauss314/skills.
2025Emma/vibe-coding-cn
Comprehensive Polymarket skill covering prediction markets, API, trading, market data, and real-time WebSocket data streaming.
alsk1992/CloddsBot
Signal trading - RSS, Twitter, Telegram triggers to trades. An agent skill from alsk1992/CloddsBot.
alsk1992/CloddsBot
Verify agent identity using ERC-8004 on-chain registry. An agent skill from alsk1992/CloddsBot.
agiprolabs/claude-trading-skills
Solana token market data via Birdeye — prices, OHLCV, trades, token metadata, security checks, and trader activity
agiprolabs/claude-trading-skills
Broad crypto market data from CoinGecko covering 13,000+ tokens.
agiprolabs/claude-trading-skills
Cointegration testing for pairs trading using Engle-Granger, Johansen, and rolling stability analysis
agiprolabs/claude-trading-skills
Wallet evaluation, monitoring, and copy-trade strategy design for Solana DEX trading
agiprolabs/claude-trading-skills
Cross-asset correlation analysis including rolling correlation, hierarchical clustering, tail dependence, and regime-dependent correlation
agiprolabs/claude-trading-skills
Multi-method cost basis computation including specific identification, FIFO, LIFO, HIFO, and proportional average cost with partial sell handling
Categories
Event-driven backtesting with bar-by-bar execution, complex order types, multiple analyzers, and custom indicators. Backtrader is an agent skill from agiprolabs/claude-trading-skills.
Backtrader fits situations like: tasks that involve Event-driven systems; tasks that involve Trading and backtesting.
Run `npx skills add agiprolabs/claude-trading-skills --skill backtrader -a claude-code`. Or copy the skill folder (skills/backtrader in agiprolabs/claude-trading-skills) into .claude/skills/backtrader in your project. Claude Code loads it when a task matches its description.
Run `npx skills add agiprolabs/claude-trading-skills --skill backtrader -a codex`. Or copy the skill folder (skills/backtrader in agiprolabs/claude-trading-skills) into .agents/skills/backtrader in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add agiprolabs/claude-trading-skills --skill backtrader -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/backtrader, .gemini/skills/backtrader, .github/skills/backtrader and .opencode/skills/backtrader in your project.
Going by SKILL.md and its folder, Backtrader needs Python for the scripts in its folder and the command-line tools its instructions call (python and uv). Our summary lists: Python 3.
SKILL.md contains no URLs. Its commands use uv, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
Backtrader is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.4k tokens (SKILL.md is roughly 9.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 4k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Backtrader: Llmquant Strategies (LLMQuant/skills, 229 stars), Cryptofeed (2025Emma/vibe-coding-cn, 23k stars), Backtesting (gauss314/skills, 246 stars) and Polymarket (2025Emma/vibe-coding-cn, 23k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
agiprolabs (a GitHub user) maintains it in agiprolabs/claude-trading-skills, which has 410 GitHub stars. The repository holds 68 skills in this directory. The repository was last updated on September 3, 2026.
Source: agiprolabs/claude-trading-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.