Skip to main content
skill CX Codex

pine-backtester — Claude Code skill: what it does, how to install

Adds performance metrics, trade tracking, and statistical validation to Pine Script indicators and strategies. Handy when evaluating trading systems.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add TradersPost/pinescript-agents --skill pine-backtester -a claude-code
Open on GitHub

What pine-backtester does

Evaluating trading scripts requires reliable statistics across historical bars. The skill injects backtesting routines directly into Pine Script strategies and indicators. It calculates win rate, profit factor, maximum drawdown, as well as Sharpe and Sortino ratios. For signal validation, it adds accuracy checks, false positive rates, and Monte Carlo runs.

The implementation focuses on user-defined types (UDTs) to record each executed order. Storing entry prices, exit reasons, and timestamps inside custom types allows plotting trade lines with xloc.bar_time, bypassing the standard 5000-bar limit. It applies Pine Script v6 patterns, including multi-section string reports up to 40,960 characters and for...in array iteration.

Agent access relies on Read, Edit, Grep, and Glob tools. Traditional loops with dynamic boundaries create infinite loop risks in Pine Script, so the skill enforces safe array iteration or cached boundary sizes.

What it helps with

  • Compute win rate, profit factor, Sharpe, and Sortino ratios
  • Measure false positive rates and signal lag across timeframes
  • Track historical trade entries and exits using custom UDT structures
  • Draw an on-chart summary table for strategy performance
  • Run Monte Carlo simulations to assess strategy stability

Example prompts for the agent

  • Add maximum drawdown and Sharpe ratio tracking to my Pine Script strategy
  • Build an on-chart table showing win rate and profit factor using Pine Script v6
  • Refactor trade result calculations to use for...in loops and a custom Trade UDT

How to install pine-backtester

1Skills CLI (Vercel)

npx skills add TradersPost/pinescript-agents --skill pine-backtester -a claude-code

2Manually: put the files in place

~/.claude/skills/pine-backtester/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/pine-backtester/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about pine-backtester

How to install pine-backtester in Claude Code?

Run npx skills add TradersPost/pinescript-agents --skill pine-backtester -a claude-code. The command registers the skill within your agent setup.

What does pine-backtester do?

It equips Claude Code with patterns for testing Pine Script strategies and indicators. It inserts performance tables, drawdown calculations, and trade distribution tracking.

How does it visualize trades past the 5000-bar limit?

It tracks trade events inside a custom Trade UDT and renders lines using xloc=xloc.bar_time. That prevents historical bar limits from truncating past trades.

Similar skills

Everything for Finance and business →

From the same set4

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor