Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add Miha21222/tradingview-mcp --skill strategy-backtestinggit clone --depth 1 https://github.com/Miha21222/tradingview-mcpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/miha21222/tradingview-mcp/strategy-backtesting)<a href="https://agentmods.dev/skills/miha21222/tradingview-mcp/strategy-backtesting"><img src="https://agentmods.dev/badge/skills/miha21222/tradingview-mcp/strategy-backtesting.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00072 | $0.01394 |
| Opus 5 | $0.00036 | $0.00697 |
| Sonnet 5 | $0.00014 | $0.00279 |
| Haiku 4.5 | $0.00007 | $0.00139 |
Grade A, and why
strategy-backtesting scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 102 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Strategy backtesting
Run vetted strategies over historical bars with account-correct math: pip sizes (incl. JPY), risk-based position sizing from the actual stop distance, pip-scaled spread, and explicit fill semantics. Strategies are declarative YAML or built-in only — never run user/LLM Python code (blocked by the hard rules).
When to use
- You want a statistical read (win rate, expectancy, profit factor, R distribution) on a rule-based idea, not a gut feeling.
- You need to compare a strategy across parameters or timeframes.
- You have a declarative spec and want to run it over fresh data.
Tools
tv_backtest_run— run a built-in strategy (sma_cross,breakout,smc_h4_m15) with full currency/spread/fill controls.tv_backtest_render_trades— same backtest, but renders the most recent N closed trades to PNGs (entry line, SL red, TP green, exit labeled with R, band over the trade's lifetime) for a visual sanity check of the fills; needs headless Chromium.extra_markup_jsonlayers custom drawings (killzones, boxes, text, markers, hex colors — full tv_chart_render schema) onto every image.- Fully custom screenshots:
tv_backtest_rungives every trade's entry/exit times + prices + sl/tp; feed them totv_chart_renderwithend_time(window any historical trade) and your ownmarkup_json. A user's preferred style (colors, what to draw, sizes) belongs in a skill file so the agent applies it every time — that's the customization path, no code changes. tv_strategy_list— list declarative YAML strategies inTV_STRATEGY_DIR.tv_strategy_run— run a declarative YAML strategy (same engine as backtest).tv_data_get_bars— fetch the bars you intend to test.
Honest interpretation checklist
- Fill model: default is next-bar-open (
trade_on_close=false). Trades that signal on a bar fill at the next open — this is the conservative real-world default.trade_on_close=truefills at the signal bar close (optimistic; only if your execution genuinely works that way). - Look-ahead: ensure the strategy only used information available at the signal bar (the built-ins shift their indicators by one bar). Never test a rule that references the outcome bar.
- Sample size: per setup, fewer than ~30 trades is not evidence. Report
# Tradeswith every conclusion; a 100% win rate on 4 trades is noise. - Currency:
account_currencyandquote_to_account_rateare explicit. When the quote (e.g. JPY) differs from the account currency, supply the rate — the tool refuses to guess. - Spread:
spread_pipsis modeled as a relative rate exact at a reference price; it is applied once at entry (backtesting.py semantics). Treat reported P&L as pre-tolerance, not a broker quote. - R: each trade's
r=pnl / (size * |entry - sl|); a stop-hit is ~-1.0R. Judge a strategy by expectancy in R, not by total P&L (account size is arbitrary).
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 7d ago First seen · 102 lines · 72 tokens per session scan A 4ba1547c9521
strategy-backtesting is a skill published in the GitHub repository Miha21222/tradingview-mcp (0 stars, last pushed 12d ago), licensed MIT. It adds 72 tokens to every session and 1,394 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
sector-rotation
An analysis framework for comparing industries in the Chinese A-share stock market, using business conditions, price momentum, valuation, and money flows. It produces rankings and higher- or lower-allocation suggestions.
strategy-pivot-designer
Detect backtest iteration stagnation and generate structurally different strategy pivot proposals when parameter tuning reaches a local optimum.
twitter-reader
Read Twitter/X for financial research using opencli (read-only). Use this skill whenever the user wants to read their Twitter feed, search for financial tweets, view bookmarks, look up user profiles, or gather market sentiment from Twitter/X. Triggers include: "check my feed", "search Twitter for", "show my…
chenhao-limit-up
A framework for judging Chinese A-share stocks that have reached the daily price-rise limit, using market mood, sector leadership, and trading momentum.
trading-risk-gate
Unified pre-trade safety gate: Ruin check (Law #1), ergodicity audit, and win-rate dominance validation. Absorbs: ergodicity-check, law-of-ruin, win-rate-dominance.
vectorbt
High-performance vectorized backtesting with parameter optimization, portfolio simulation, and rich performance metrics.