Skip to content
TradequixDocsOpen the terminal
OverviewStart here, search, progress
  • Introduction
  • Quickstart
  • How a script runs
  • Types and qualifiers
  • Operators, conditionals and loops
  • Functions and methods
  • Objects and enums
  • Arrays, matrices and maps
  • Strings and colours
  • Time and sessions
  • Bar states
  • Plotting
  • Inputs
  • Technical analysis
  • Drawings and tables
  • Multiple timeframes
  • Strategies
  • Alerts in scripts
  • Repainting
  • The Pine editor
  • Indicator settings
  • Coming from TradingView
  • The data
  • Publish and sell
  • Catalogue and community
  • Your dashboard and earnings
  • Errors and debugging
  • Limits
  • Coverage
  • Built-in catalogue
  • Cookbook
  • Write Pine with AI
  • FAQ
  • Glossary
  • Cheat sheet
  • Function reference
  • Will it run here?
  • Error index

On Tradequix

Errors and debugging

Read the editor console, recognise the common errors and their real causes, and find out why a script runs but draws nothing.

View as MarkdownOpen in ClaudeOpen in ChatGPT

When a script fails, the editor's console says what went wrong and, when it can, which line. Warnings (a script that runs but with a caveat) appear there too, along with any alert() events.

Kinds of error#

KindMeansUsually
TranspileThe code could not be understoodA typo, a missing bracket, wrong indentation
RuntimeIt ran and then failed on some barDividing by na, an array index out of range, a bad argument
TimeoutIt did not finish in timeAn unbounded loop

Every runnable example in these docs reports errors the same way. Try breaking one:

RunnableSpot the mistake
1//@version=62indicator("Spot the mistake")3len = 144r = ta.rsi(close, len)5plot(r, "RSI", color = color.purple)6hline(50)

Change ta.rsi to ta.rsii and press Run to see a real error message.

Common errors and their real causes#

"Loop exceeded maximum iterations" comes from a while or for loop that never ends. The engine stops it rather than hang the chart.

"This feed cannot serve the '…' timeframe." A request.security asked for less than five seconds. See Multiple timeframes.

Indentation. Blocks under if, for and functions are indented by four spaces (or one tab). A line indented by a different amount is a transpile error.

Saved setting no longer exists. A warning, not an error: an input you had customised was removed from the script. See Inputs.

It runs, but draws nothing#

Work through these in order:

  1. Is the value ever not na? Long lookbacks need history. Plot the raw series and look for a line.
  2. Is a plotshape series ever true? Markers need true or a non-zero number. Plot the condition as a number (plot(cond ? 1 : 0)) to see.
  3. Is it on the right scale? An oscillator with overlay = true draws its 0 to 100 values on a price chart where it is off screen. Remove overlay.
  4. Is the drawing only on the last bar? barstate.islast objects appear at the right edge. Scroll there.
  5. Is the colour transparent? color.new(c, 100) is invisible.

Seeing values#

  • Plot it. A temporary plot(x, "debug") shows every bar's value in the indicator's legend as you move the crosshair. Put it in a pane script so it gets its own scale.
  • A table on the last bar is a quick dashboard of current values; see Drawings and tables.
  • A label with str.tostring(x) shows a value at a specific bar.
  • alert("x = " + str.tostring(x)) writes to the console each time it runs.
PreviousYour dashboard and earningsNext Limits

On this page

  • Kinds of error
  • Common errors and their real causes
  • It runs, but draws nothing
  • Seeing values

Use with AI

View as MarkdownOpen in ClaudeOpen in ChatGPT