Edgoro
AI · Free tool

Pine Script Checker

Paste a Pine Script for an instant v6 check: old v4/v5 code, syntax and scope errors, repainting, strategies without costs or exits. Free.

0 / 60,000
Free and unlimited, no sign-up. The check runs in your browser: your code never leaves this page.

Trading involves substantial risk of loss and is not suitable for every investor. Edgoro is a software tool, not a broker or financial adviser: nothing it produces is investment advice, and past or backtested performance does not guarantee future results.

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

  1. Copy the whole script: from TradingView's Pine Editor, from GitHub, or from a chatbot's answer.
  2. Paste it into the box and click Check my script.
  3. 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.
  4. 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.
  5. 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

CheckWhat it catches
Version and declarationNo //@version line, an older version, no indicator(), strategy() or library(), or more than one
Old v4 and v5 codestudy(), security(), bare sma(), ema(), rsi(), crossover() and the other names that moved to ta., math., str. and request.; input.integer, tickerid, period
Removed argumentswhen= in strategy orders, transp= in plots and backgrounds
v6 bool rulesA 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)
Typesna assigned without a type (var x = na), a string added to a number
StructureUnbalanced brackets, a block with no indented body, block lines not indented by 4 spaces, wrapped lines indented by a multiple of 4, curly quotes
Scopeplot(), bgcolor(), fill() or alertcondition() inside an if, a loop or a function; a function that changes a global variable; the same name declared twice
TyposA name one or two letters away from a variable you declared (lenght for length)
Repaintingrequest.security() with lookahead_on and no [1] offset
Strategy realismstrategy() without commission or slippage, entries with no exit or stop, strategy.exit() given both a price and a tick level
OutputAn 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.

Frequently asked questions

Is the Pine Script checker free?

Yes, free and unlimited, with no account. It runs in your browser, so there is no quota to protect.

Does it compile my script?

No. TradingView doesn't offer its compiler to other sites, so the checker reads the code against the Pine Script v6 rules instead. It catches most of the errors that AI tools and old scripts produce, but TradingView's Pine Editor remains the final check.

Is my code sent anywhere?

No. The check runs entirely in your browser: the script isn't uploaded, stored or logged. Only if you click Fix it with the free AI fixer is it passed to that tool, which sends it to the AI model to write a correction.

Which Pine Script versions can I check?

Any, but the rules are those of version 6. A v4 or v5 script is reported with what has to change for it to work as v6.

Why does it flag my strategy when it compiles?

Notes aren't errors. A strategy without commission or slippage, or with entries but no exit, compiles fine but shows backtest results that real trading can't reproduce. Fix them if you want realistic numbers.

Can it check strategies and libraries?

Yes. It reads indicator(), strategy() and library() scripts. It can't see what an imported library contains, so names that come from a library are never flagged.

Related guides

All guides
All free tools

Let AI build the indicator behind your numbers.

Turn the rules you just calculated into a TradingView indicator, an MT5 bot or a crypto bot. Instant access, with a 7-day money-back guarantee.