Pine Script errors, as TradingView prints them
69 compiler messages traders search for, each compiled on TradingView from a short script: what causes it, the fix that compiles, and that script loaded in the checker.
Updated 23 October 2026. Runs in your browser; nothing you type is uploaded.
Try a worked example
Uses when=, transp=, 250 / 100, a ta.* call after and, profit with limit, and no margin settings.
Converted to v6: 3 edits applied · 4 decisions (4 set to keep v5)
Behaves as your v5 script did. Switch any decision below to v6.
Show the full v6 code
//@version=6
strategy("v5 RSI breakout (worked example)", overlay = true, margin_long = 0, margin_short = 0)
basis = ta.sma(close, 20)
rsi = ta.rsi(close, 14)
riskTicks = int(250 / 100)
crossover_8 = ta.crossover(rsi, 50)
longSignal = close > basis and crossover_8
plot(basis, "Basis", color = color.new(color.orange, 30))
if longSignal
strategy.entry("Long", strategy.long)
strategy.exit("Exit", "Long", limit = close * 1.03, loss = riskTicks * 100)
Needs your decision
Converted automatically (3)
- Line 1: The header now says //@version=6 This is the conversion itself. Every place where v6 then behaves differently is listed on this page. TradingView's guide on this See line 1 in the diff
- Line 9: transp = folded into color.new() (plot) v6 removed transp=. color.new() gives the same colour the same transparency. TradingView's own converter drops transp, which makes the plot opaque. TradingView's guide on this See line 9 in the diff
- Line 11: when = moved into an if block (strategy.entry) v6 removed when=. v5 placed the order only when the condition was true, and an if block around the call does the same. TradingView's guide on this See line 11 in the diff
Notes: no edit needed (1)
- Past 9,000 orders, v6 drops the oldest instead of stopping. A v5 strategy stopped with an error past 9,000 orders (outside Deep Backtesting). v6 keeps running and drops the oldest ones from its results, so strategy.closedtrades.* on those returns na. strategy.closedtrades.first_index gives the first one kept. TradingView's guide on this
Next: paste it into TradingView's Pine Editor, save, and add it to the chart. An error? Find its message below, or let Pine Fixer fix it. How to add a script
v5 RSI breakout (worked example), Pine v5 strategy
No repaint flags found · 7 Pine v6 migration items
Static repaint checks passed, but the script uses legacy Pine syntax or an older //@version header that needs updating for Pine Script v6.
Critical repaint flags
0
0 caution flags to verify
Bar-close gate
Not found
barstate.isconfirmed or a bar-close alert
Higher-timeframe calls
0
request.security() calls, of a 40 limit
Plots and alerts
1
Plots, of a 64 limit; 0 alerts
Repaint and lookahead
No lookahead leaks, unshifted request.security() calls or realtime-only signal branches found in this snippet.
Want TradingView indicators whose Pine Script v6 source already passes every check?
Every desk in Pine Pro Library ships as readable .pine v6 source with confirmed higher-timeframe requests and barstate.isconfirmed event logging.
Every message, by what went wrong
Compiled on TradingView 23 October 2026. Messages marked v5 are the wording of //@version=5 scripts.
Scope: where a call or an assignment may go
- Cannot use "plot" in local scope
- Cannot use "plotshape" in local scope
- Cannot use "bgcolor" in local scope
- Cannot use "alertcondition" in local scope
- Cannot use "hline" in local scope
- Cannot use "fill" in local scope
- Cannot modify global variable "count" in function
- Function arguments cannot be mutable ("x")
- "a" is already defined
Names Pine cannot find
- Could not find function or function reference 'study'
- Could not find function or function reference 'security'
- Undeclared identifier "diff"
- Undeclared identifier "color.gold"
- Undeclared identifier "color.cyan"
- Could not find function or function reference 'iff'
- Could not find function or function reference 'ta.adx'
- Could not find function or function reference 'ta.sum'
- Could not find function or function reference 'ta.obv'
- Could not find function or function reference 'math.clamp'
- Could not find function or function reference 'dayofyear'
- Could not find function or function reference 'ema'
- Could not find function or function reference 'sma'
- Could not find function or function reference 'input.integer'
- Could not find function or function reference 'ta.kama'
- Could not find function or function reference 'ta.cmf'
- Could not find function or function reference 'ta.plus_di'
- Could not find function or function reference 'ta.slope'
- Could not find function or function reference 'ta.ichimoku'
- Could not find function or function reference 'ta.crossabove'
- Could not find function or function reference 'math.tanh'
- Could not find function or function reference 'math.mod'
- Could not find function or function reference 'input.timezone'
Syntax: lines, brackets and characters
- Mismatched input 'end of line without line continuation' expecting ')' (v5)
- Syntax error: Missing closing parenthesis
- Syntax error: Extra closing parenthesis
- Syntax error at input "end of line without line continuation"
- Syntax error at input "strategy"
- Syntax error at input "label"
- Syntax error at input "line"
- Syntax error at input "plotshape"
- Syntax error at input "plot"
- Syntax error at input "overlay"
- Syntax error at input "new line"
- Mismatched input 'strategy' expecting 'end of line without line continuation' (v5)
- Mismatched input 'if' expecting 'end of line without line continuation' (v5)
- Mismatched input 'label' expecting 'end of line without line continuation' (v5)
- Mismatched input "if" expecting set "end of line without line continuation"
- Extraneous input ":" expecting "end of line without line continuation"
- no viable alternative at character "“"
Arguments a function does not have
- The "strategy.entry" function does not have an argument with the name "when"
- The "plot" function does not have an argument with the name "transp"
- The "strategy.close" function does not have an argument with the name "when"
- The "strategy.entry" function does not have an argument with the name "qty_percent"
- The "plot" function does not have an argument with the name "scale"
- The "plot" function does not have an argument with the name "overlay"
- The "plot" function does not have an argument with the name "width"
- The "strategy" function does not have an argument with the name "timeframe"
- The "input" function does not have an argument with the name "options"
- The "input.float" function does not have an argument with the name "help"
- The "input.int" function does not have an argument with the name "help"
- The 'input.int' function does not have an argument with the name 'active' (v5)
- The "plotshape" function does not have an argument with the name "shape"
- The "indicator" function does not have an argument with the name "calc_on_every_tick"
- The "label.new" function does not have an argument with the name "bgcolor"
- The "fill" function does not have an argument with the name "transp"
- The 'plot' function does not have an argument with the name 'linestyle' (v5)
Types: na, series, simple and const
- Value with NA type cannot be assigned to a variable that was defined without type keyword
- Cannot call "alertcondition" with argument "message"="call "operator +" (series string)". An argument of "series string" type was used but a "const string" is expected.
- Cannot call "ta.ema" with argument "length"="len". An argument of "series int" type was used but a "simple int" is expected.
Have your AI fix the next one
- Pine Fixer An AI skill pack for 45 compiler-verified Pine v6 failure classes, with a repaint clinic. $9.99 once.