ia-pinescript

ia-pinescript is a skill for Claude Code from iliaal/whetstone. It costs 41 tokens per session (1,806 once invoked), scanned A, a copy of pinescript, MIT.

A guide to writing and troubleshooting Pine Script version 6, the language used for TradingView chart indicators and trading strategies. It also covers performance, chart visualization, and historical testing of strategies.

In plain words
What is it for?
Use it to write or debug TradingView indicators and strategies, check version-specific syntax, improve script performance, backtest ideas, and prevent repainting.
Why use it?
It helps avoid Pine Script syntax errors and charting behaviors that can produce misleading results, such as changing past signals while a bar is still forming.

Skill for Claude Code

Written for Claude Code: paths in frontmatter.

Part of the whetstone plugin — 32 skills, 22 commands, 19 agents, 1 hook, 1 MCP server shipped together

Good fit Use it to write or debug TradingView indicators and strategies, check version-specific syntax, improve script performance, backtest ideas, and prevent repainting.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/iliaal/whetstone/ia-pinescript
Install

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.

Any agent
npx skills add iliaal/whetstone --skill ia-pinescript
Clone the repo
git clone --depth 1 https://github.com/iliaal/whetstone

Made for: Claude Code.

Or install whetstone, the plugin that ships this one along with the rest of its 32 skills, 22 commands, 19 agents, 1 hook, 1 MCP server.

Wrote 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.

agentmods badge for ia-pinescript

README.md
[![agentmods](https://agentmods.dev/badge/skills/iliaal/whetstone/ia-pinescript/github.svg)](https://agentmods.dev/skills/iliaal/whetstone/ia-pinescript)
Your own site
<a href="https://agentmods.dev/skills/iliaal/whetstone/ia-pinescript"><img src="https://agentmods.dev/badge/skills/iliaal/whetstone/ia-pinescript/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ia-pinescript

Your own site · 80×15
<a href="https://agentmods.dev/skills/iliaal/whetstone/ia-pinescript"><img src="https://agentmods.dev/badge/skills/iliaal/whetstone/ia-pinescript.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,806 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 89% copy Near-identical to another mod in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00041 $0.01806
Opus 5 $0.00020 $0.00903
Sonnet 5 $0.00008 $0.00361
Haiku 4.5 $0.00004 $0.00181

Measured yesterday against content hash 9da78d4e962a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

ia-pinescript 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 yesterday.

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.

Origin

This is a copy

89% identical to pinescript — 2 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

plugins/whetstone/skills/ia-pinescript/SKILL.md · 96 lines

How it starts

The opening of the file, as written. The whole thing — 96 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Pine Script Development

Verify before implementing: For Pine Script version-specific syntax or new built-in functions, look up current docs via Context7 (query-docs) before writing code. TradingView updates Pine Script frequently and training data may be stale.

Critical Syntax Rules

  • Keep simple ternaries readable; multiline expressions require valid continuation indentation. For complex ternaries, use intermediate variables:
    isBull = close > open
    barColor = isBull ? color.green : color.red
    
  • Continuation lines outside parentheses MUST be indented by a non-multiple of 4 -- same indentation as the start errors, and 4/8/12 spaces parse as a local block and error too (2 spaces is the conventional choice). Inside parentheses (function calls, parenthesized expressions) any indentation works, including multiples of 4
  • NEVER use plot() inside local scopes (if/for/functions) -- use conditional value instead: plot(condition ? value : na)
  • Use barstate.isconfirmed when signals require the chart bar's closing values. It does not establish that requested higher-timeframe values are confirmed; inspect request.security() offsets and lookahead separately.

Platform Limits

Check the current platform limits before sizing a script: 64 plot counts (one call can consume several); up to 500 line, box, or label IDs each and 100 polyline IDs; 40 unique request.*() calls, or 64 on Ultimate; 100,000 compiled tokens. History buffers, requested intrabars, and chart history have distinct limits; there is no general 500-bar request.security() history limit.

  • Drawings positioned with xloc.bar_index reach at most 9,999 bars into the past and 500 into the future; for anything older, switch the drawing to xloc.bar_time and pass a timestamp (a time value without xloc.bar_time is treated as a future bar index and errors)
  • Set the relevant max_*_count declaration parameter and cap growth with a rolling buffer: push each object, then line.delete(arr.shift()) after the intended line count is exceeded. The default display count is approximately 50 per drawing type.

Read the full file on GitHub · 96 lines

Files

What ships with it

2 files 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.

Changes

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.

  1. yesterday Changed 9da78d4e962a
  2. 2d ago First seen · 96 lines · 41 tokens per session scan A 088a355a31d4

Subscribe to this mod's changes

ia-pinescript is a skill published in the GitHub repository iliaal/whetstone (33 stars, last pushed 2d ago), licensed MIT. It adds 41 tokens to every session and 1,806 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 89% identical to pinescript, differing in 2 lines, and is treated as a copy.

Related

Other skills, from other repositories

vertical-fintech-mobile

Domain-knowledge pack for money on a phone — wallets, payments, custody and signing, transaction lifecycle, KYC/AML gates, and offline reconciliation. The rules that separate a payments app from a CRUD app with a currency symbol: a balance is a claim about a server, an idempotency key must outlive the process that…

avelikiy/great_cto · 119 tokens

product-economics

Does this product make money at a price someone will pay? Forces contribution margin, a price with a stated basis, and a bottom-up market size — each number labelled measured / assumed / unknown, so a guess can never be read as a calculation.

avelikiy/great_cto · 55 tokens

quant-validation

The methods a financial-ML result has to survive before it is evidence — purged cross-validation with an embargo, triple-barrier labelling, sample uniqueness under overlapping labels, fractional differentiation, meta-labelling, and multiple-testing correction. Written because the invariants were required of…

avelikiy/great_cto · 104 tokens

review-responder

Use when receiving feedback on code you implemented, responding to reviewer comments, deciding which review suggestions to implement, or pushing back on incorrect review feedback.

Joncik91/ucai · 33 tokens

pr-sweep

Use when you want to sweep all open pull requests across all repos, triage their status, run code reviews on unreviewed PRs, merge what's ready, fix quick blockers, and produce a full status report. Trigger when the user says "check my PRs", "close out open PRs", "what's the status of my PRs", "sweep my PRs", "PR…

harnessprotocol/harness-kit · 0 tokens

rubber-ducky

Use when you've planned a non-trivial change and are about to implement it, finished a complex or multi-file piece of work, just wrote tests, or are stuck on repeated failures — and any time the user says "rubber duck this", "rubber ducky", "get a second opinion", "sanity-check my plan", "poke holes in this", "what am…

harnessprotocol/harness-kit · 186 tokens