pinescript

pinescript is a skill for Claude Code from iliaal/ai-skills. It costs 40 tokens per session (2,018 once invoked), scanned A, original, MIT.

A set of guidance for writing and debugging Pine Script v6, the programming language used for TradingView indicators and trading strategies.

In plain words
What is it for?
Use it to create or troubleshoot TradingView indicators, strategies, backtests, and chart visualizations.
Why use it?
It helps avoid Pine Script syntax errors, repainting, invalid plotting patterns, and platform limit problems.

Skill for Claude Code

Written for Claude Code: paths in frontmatter.

Good fit Use it to create or troubleshoot TradingView indicators, strategies, backtests, and chart visualizations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/iliaal/ai-skills/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/ai-skills --skill pinescript
Clone the repo
git clone --depth 1 https://github.com/iliaal/ai-skills

Made for: Claude Code.

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 pinescript

README.md
[![agentmods](https://agentmods.dev/badge/skills/iliaal/ai-skills/pinescript/github.svg)](https://agentmods.dev/skills/iliaal/ai-skills/pinescript)
Your own site
<a href="https://agentmods.dev/skills/iliaal/ai-skills/pinescript"><img src="https://agentmods.dev/badge/skills/iliaal/ai-skills/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 pinescript

Your own site · 80×15
<a href="https://agentmods.dev/skills/iliaal/ai-skills/pinescript"><img src="https://agentmods.dev/badge/skills/iliaal/ai-skills/pinescript.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,018 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found 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.00040 $0.02018
Opus 5.5 $0.00016 $0.00807
Sonnet 5.5 $0.00008 $0.00404
Haiku 4.5 $0.00004 $0.00202

Measured 12d ago against content hash cd6fda52c34c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

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 12d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

skills/pinescript/SKILL.md · 102 lines

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.

Pine Script Development

Verify before implementing: For Pine Script version-specific syntax or new built-in functions, look up current official docs before writing code. Prefer Context7 (query-docs) when available. Otherwise use available web tools to read the TradingView Pine Script docs for the script's version. 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 · 102 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. 12d ago Changed · +1 lines cd6fda52c34c
  2. 20d ago Changed · +5 lines 551eeab5d9e9
  3. 27d ago Changed e549ba4f3856
  4. 1mo ago Changed · +3 lines f856719deafe
  5. 1mo ago First seen · 93 lines · 40 tokens per session scan A bff20c784565

Subscribe to this mod's changes

pinescript is a skill published in the GitHub repository iliaal/ai-skills (45 stars, last pushed 5d ago), licensed MIT. It adds 40 tokens to every session and 2,018 once invoked, about $0.0002 per session on Opus 5.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-30.

Related

Other skills, from other repositories

alpha-evaluate

A multi-step workflow for testing an investment factor, meaning a measurable stock signal, against market data. It examines predictive relationship, grouped returns, risk-adjusted results, consistency, and robustness.

VernonOY/alpha-skills · 74 tokens

alpha-backtest

A strategy backtesting workflow that tests factor-based stock portfolios on historical data. Backtesting means simulating how a strategy would have performed in the past.

VernonOY/alpha-skills · 56 tokens

alpha-mine

An automated process for proposing and testing stock-market formulas, called factors, that combine price or trading data with mathematical operations. It screens the candidates using measures such as IC, which compares a factor with later returns.

VernonOY/alpha-skills · 73 tokens

alpha-autopilot

An automated research loop for investment factors, which are measurable signals used to select or compare stocks. It finds candidates, tests them, records successful ones, monitors active factors, and retires those that weaken.

VernonOY/alpha-skills · 85 tokens

alpha-signal

A daily trading-signal generator that reads active investment factors, scores current market data, and produces a target portfolio. Factors are measurable rules used to rank investments.

VernonOY/alpha-skills · 70 tokens

alpha-discover

A quantitative-research workflow that turns a natural-language stock-market idea into a measurable trading factor. A factor is a rule or signal used to compare investments and test whether it relates to future returns.

VernonOY/alpha-skills · 53 tokens