Pine Script v6 technical guides
Pine Script Error Lab
Start with the message or symptom you see. Each guide shows a minimal broken script, a focused fix, the exact diff, the validation level, and the TradingView source that supports the explanation.
Browse 12 error guidesVerification is part of the answer
A grammar pass is not a TradingView runtime test. Every page states what was checked, when it was checked, and what still needs chart or dataset validation.
Compilation errors
Fix syntax, scope, function lookup, plot placement, and v6 Boolean conditions before the script can run.
Fix “Undeclared identifier” in Pine Script
Undeclared identifier "candleRange"
Open guideFix “Mismatched input” in Pine Script
Mismatched input at “label.new”; an indented local block was expected.
Open guideFix “Could not find function or function reference”
Could not find function or function reference “ta.average”.
Open guideFix `plot()` in local scope
Cannot use “plot” in local scope.
Open guideFix CE10101: `if` condition must evaluate to `bool`
The condition of the “X” statement must evaluate to a “bool” value.
Open guideCompiler warnings
Resolve calculations that compile but can build inconsistent history across bars.
Runtime errors and resource limits
Separate syntax from failures that depend on chart data, execution time, memory, drawings, or requested datasets.
Fix RE10139: Memory limits exceeded
Memory limits exceeded.
Open guideFix RE10143: historical offset beyond buffer limit
The requested historical offset (X) is beyond the historical buffer’s limit (Y).
Open guideFix a Pine Script loop that takes too long
Loop is too long (> 500 ms).
Open guideFix too many Pine Script drawings
Older drawings disappear or the script reaches a drawing ID limit.
Open guideFix too many unique `request.*()` calls
The script executes too many unique `request.*()` function calls.
Open guideStrategy troubleshooting
Diagnose an empty strategy report when no single compiler or runtime message explains the outcome.
Need help with the full script?
Open the Coding Agent overview to paste editable Pine Script, describe the intended behavior, and request a review. TradingView compilation and chart testing remain the final checks.
Open Pine Script AI Coding Agent