QTrader
Menu

Diagnose Pine Script errors

Separate compiler errors, ignored features and strategy logic problems using a small reproducible script.

Before you start

Separate three cases: the compiler rejects a construct, the compiler warns that it ignores a construct, or the script compiles but the trading logic produces an unexpected result. Fixing a syntax error does not validate the strategy. Keep the script, diagnostics and market settings together.

Follow the workflow

  1. Start from the first diagnostic and its line number. Check spelling, argument names and supported value types.
  2. Compare that operation with Pine compatibility. An unsupported external import or lower-timeframe request needs a supported approach, not another version marker.
  3. Temporarily reduce the script to one input, one indicator and one entry/exit condition. Add the removed pieces back one at a time.
  4. When compilation succeeds, inspect Notes and run a backtest. For an empty trade list, continue with the no-trades checklist instead of repeatedly changing syntax.

Worked example

Open the working SMA script. Change one average length through its declared input and compile it. Then compare your own failing operation with the working calls. Keep the untouched bundled example available so a market/data problem can be distinguished from a code problem.

Open the working example

Limits and interpretation

A drawing or alert call may be ignored with a warning; its successful parsing does not add a plotted object or delivery channel. Some risk controls also have different support statuses. Strategy signals run in a sandbox; arbitrary packages and network calls are outside that contract. The reference is more precise than a claim that every script will run unchanged.

The interactive workbench needs JavaScript. Reload this page if interactive controls could not load.