What the Pine Script checker does
Paste a script and the checker reads it line by line against the rules of Pine Script version 6. It lists what TradingView would refuse, with the line and a link to the fix. It also flags problems a compiler never mentions because the code is valid: a higher-timeframe request that repaints, a strategy that backtests without fees, an entry with no exit.
It runs in your browser. Your code isn't uploaded or saved, there's no account and no limit.
The checker is Edgoro Pine Check, the same engine Edgoro runs on every script its builder writes, before you see it.
How to use it
- Copy the whole script: from TradingView's Pine Editor, from GitHub, or from a chatbot's answer.
- Paste it into the box and click Check my script.
- Read the problems first. Each one gives the line, what's wrong and a link to a page with a broken and a fixed example.
- Then read the notes. They don't stop the script from compiling, but they change what you see on the chart or in the Strategy Tester.
- Edit the code in the box: the result updates as you type. When the list is empty, save the script in the Pine Editor, which compiles it.
Want the fixes written for you? Fix it with the free AI fixer opens the AI Pine Script error fixer with your script and the problems already filled in.
What it checks
| Check | What it catches |
|---|---|
| Version and declaration | No //@version line, an older version, no indicator(), strategy() or library(), or more than one |
| Old v4 and v5 code | study(), security(), bare sma(), ema(), rsi(), crossover() and the other names that moved to ta., math., str. and request.; input.integer, tickerid, period |
| Removed arguments | when= in strategy orders, transp= in plots and backgrounds |
| v6 bool rules | A bool set to na, true/false mixed with na in a ternary, na() or nz() on a bool, a number used as a condition (if volume) |
| Types | na assigned without a type (var x = na), a string added to a number |
| Structure | Unbalanced brackets, a block with no indented body, block lines not indented by 4 spaces, wrapped lines indented by a multiple of 4, curly quotes |
| Scope | plot(), bgcolor(), fill() or alertcondition() inside an if, a loop or a function; a function that changes a global variable; the same name declared twice |
| Typos | A name one or two letters away from a variable you declared (lenght for length) |
| Repainting | request.security() with lookahead_on and no [1] offset |
| Strategy realism | strategy() without commission or slippage, entries with no exit or stop, strategy.exit() given both a price and a tick level |
| Output | An indicator that draws nothing, alerts you asked for but don't exist, ta.* calls that don't run on every bar |
What it doesn't do
- It isn't TradingView's compiler. TradingView doesn't offer its compiler to other sites, so the checker reads the code instead of compiling it. The Pine Editor stays the final check.
- Type-qualifier errors get through. Messages such as "series int used but simple int expected" depend on how TradingView infers the type of every value, which a reader of the code can't fully reproduce. The Pine Script errors reference explains each of them.
- Libraries are invisible. It can't see what an imported library contains, so a name that comes from a library is never reported as a typo.
- Runtime limits aren't checked. A loop that takes too long, too many drawings or too many requests only show up when the script runs on a chart.
- A clean report isn't a tested strategy. It means the code follows the rules, not that the idea makes money.
We run the checker on every complete Pine script published on this site, all of them compiled in TradingView, and it reports no error on any of them. It catches 18 of the 24 compile-error examples in our error reference; the six it misses are type-qualifier errors.
Worked example
Click Try an example to load this v5 script:
//@version=5
study("EMA cross", overlay=true)
fastLen = input.int(9, "Fast EMA")
slowLen = input.int(21, "Slow EMA")
fast = ema(close, fastLen)
slow = ta.ema(close, slowLen)
if ta.crossover(fast, slow)
plot(fast, color=color.green)
bgcolor(ta.crossunder(fast, slow) ? color.red : na, transp=80)
The checker reports five problems:
- Line 1: the script is v5, and the checks follow v6 rules.
- Line 2: study() no longer exists. It has been indicator() since v5.
- Line 5: ema() without a namespace doesn't exist: it's ta.ema().
- Line 8: plot() can't run inside the if block. Plot a conditional value at the top level instead: plot(ta.crossover(fast, slow) ? fast : na).
- Line 9: bgcolor() has no transp argument: use color.new(color.red, 80).
Each problem links to the page that shows the fix in full. Correct them one by one in the box and the list empties as you type.
Where the checker fits
Use it on code you didn't write: a script from a forum, a chatbot answer, an old v4 indicator you want to upgrade. If you'd rather start from code that's already checked, Edgoro's Pine Script generator writes v6 indicators and strategies from a plain-English description and runs this same check on every answer, fixing what it finds before you see it. The guide to converting Pine Script v5 to v6 goes through every change between the two versions.