trading-view
Skill2 starsChanged 6 days agoApache-2.0View on GitHub
TradingView Pine Script (v6) development: build, debug, convert and improve indicators and strategies. Use whenever the user wants to create a TradingView indicator or strategy, write or fix Pine Script code, turn a trading idea into a chart script, port an indicator from another platform (TradingView-style), convert Pine v5 code to v6, or add inputs/plots/alerts to an existing TradingView script — even if they never say "Pine Script" or "TradingView" explicitly (e.g. "build me an RSI oscillator", "I need a backtestable MA-cross strategy"). Also reach for it when the user asks about TradingView indicator logic, repainting, multi-timeframe requests, or strategy backtesting results.
In this repository17 other files it gives its agents.
- hiveSkill
- panel-authoringSkill
- plugin-authoringSkill
- slack-gif-creatorSkill
- codebase-designSkill
- code-reviewSkill
- diagnosing-bugsSkill
- fpga-verilog-quartusSkill
- researchSkill
- tddSkill
- grillingSkill
- grill-meSkill
- handoffSkill
- mcp-builderSkill
- skill-creatorSkill
- teachSkill
- to-questionnaireSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 25
Default when nothing is said: indicator(), chart timeframe, inputs for the main parameters, overlay where natural, no alerts — and say so.
- Very specific: line 36
No lookahead bias: Never pull future data into a decision.
- Very specific: line 41
Plot, don't just compute: Every computed series the user cares about should be visible: plot, plotshape, fill, bgcolor, barcolor, table, or …
- Very specific: line 60
When available, run the bundled offline validator as a pre-flight: scripts/validate_pine.sh <file> --no-hints --no-information (see "Local …
- Distinctive: line 69
Read the one(s) you need — don't read them all:
- Distinctive: line 88
Run it through the wrapper (auto-selects a Python >= 3.11):
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
TradingView Pine Script Development
Build production-quality TradingView indicators and strategies in Pine Script v6.
Ask first, then write
TradingView code is only as good as the spec. If the request does not fully specify what the script should do, ask — or state your assumptions explicitly at the top of the answer:
- Script type —
indicator()(display/analysis) orstrategy()(backtest/orders)? - Timeframe & symbol scope — chart timeframe only, or multi-timeframe via
request.security()? - Inputs — which parameters should the user be able to tune in Settings/Inputs?
- Visuals — overlay on price or separate pane? Which plots, colors, labels, tables?
- Alerts —
alertcondition,alert(), or none?
Default when nothing is said: indicator(), chart timeframe, inputs for the main parameters, overlay where natural, no alerts — and say so.
Core rules
- Pine Script v6 is the default (
//@version=6). Convert old v5 code (seereferences/common-errors.md). - Never repaint. On realtime (unclosed) bars, only emit signals on
confirmed data — use
barstate.isconfirmedor calculate onclose— so the indicator does not change after the fact. Repainting is the #1 complaint about TradingView scripts. - No lookahead bias. Never pull future data into a decision. When
requesting other timeframes, understand
barmerge.lookahead_onbefore using it (default isbarmerge.lookahead_off). - Make parameters inputs. Anything the user might reasonably want to tune
belongs in the Settings/Inputs tab via
input.*. - Plot, don't just compute. Every computed series the user cares about
should be visible:
plot,plotshape,fill,bgcolor,barcolor,table, orlabel. - One complete script per file. Copy-paste ready, no placeholders, no
pseudo-code, no
.... The user pastes it into the Pine Editor and it compiles.
Workflow
- Clarify the request (see "Ask first"). If the user gave you a strategy idea, translate it into concrete rules: entries, exits, filters, position sizing, stop/take-profit.
- Pick the right reference doc (below) and follow it.
- Write the complete script. Comment the non-obvious parts (the why, not the what). Structure: declaration → inputs → calculations → visuals → alerts.
- Self-review against the Core rules and the checklist in
references/common-errors.md. Watch for repainting, division by zero, unused variables, missingnahandling, and invalid plot arguments. When available, run the bundled offline validator as a pre-flight:scripts/validate_pine.sh <file> --no-hints --no-information(see "Local validation" below). - Deliver the code in a block the user can paste straight into the Pine Editor, plus a short "How to use" note (add to chart, what the inputs do, anything they must configure).
Reference docs
Read the one(s) you need — don't read them all:
references/language-basics.md— Pine Script v6 syntax, execution model, types, variables (var/varip), control flow, functions, namespaces.references/indicators.md— building indicators: declaration, inputs,ta.*built-ins, plotting, overlay vs. pane, complete examples.references/strategies.md— building strategies: orders, pyramiding, position sizing, backtesting realism, exits.references/inputs-settings.md— allinput.*functions, groups, sessions, symbol/timeframe inputs.references/plots-and-visuals.md—plot*,fill,bgcolor,barcolor, colors, labels, tables, line/box/polyline drawings.references/multi-timeframe.md—request.security()and friends, repainting, lookahead, HTF patterns.references/alerts.md—alertcondition,alert(), message templates, alert frequencies.references/common-errors.md— frequent compiler errors, debugging techniques, v5→v6 migration.references/cheatsheet.md— quick lookup table of the most used functions.
Local validation (offline)
The skill bundles a pure-Python static validator for Pine Script v6
(scripts/pine-validator/, upstream Poryaei/pine-script-validator, MIT).
It parses .pine files and reports syntax/semantic issues with line/column
positions — no TradingView account needed.
Run it through the wrapper (auto-selects a Python >= 3.11):
scripts/validate_pine.sh path/to/script.pine --no-hints --no-information # human text
scripts/validate_pine.sh path/to/script.pine --agent-json # agent-ready JSON
scripts/validate_pine.sh path/to/scripts/ --json # batch / directory
scripts/validate_pine.sh path/to/script.pine --sarif # CI / review tooling- Exit code
0= no error-level diagnostics,1= at least one error. - Severity toggles:
--errors/--no-errors,--warnings/--no-warnings,--information/--no-information,--hints/--no-hints. - The validator targets Pine v6 — old v4/v5 code (
study(), bareinput(),change(),max(), ...) is flagged as errors; use those diagnostics to drive a v5→v6 port. - It is a static checker, not the TradingView compiler: it can miss
semantic rules (e.g. CE10163 — ternaries cannot return tuples) and will
never catch repainting, lookahead, or runtime object-limit issues — the
human checklist in
references/common-errors.mdstill applies. - Audit mode (large corpora):
PYTHONPATH=scripts/pine-validator/src python -m pinescript_validator.audit <paths>
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

