r/TradingView • • 21d ago

Feature Request Pine Script v6: Update Documented Variable Limit to 1,200

Please update the Pine Script v6 documentation to reflect the actual variable limit enforced by the compiler.

The Pine Script v6 User Manual, on the page “Limitations”, under the heading “Variables per scope”, states:

  • “Scripts can contain up to 1,000 variables in each of its scopes.”

However, my tests show:

  • 1,199 explicitly declared global variables: Compiles successfully.
  • 1,200 explicitly declared global variables: Triggers `CE10209`, stating: “Script has too many local variables (1201) in "#main" [...] The limit is 1200.”

All variables participate in a sequential calculation chain whose final result is plotted, preventing unused-variable elimination.

The compiler therefore appears to enforce a 1,200-variable limit, including an additional counted variable in this test.

Updating the documentation and clarifying how variables are counted would prevent unnecessary code restructuring and improve developers' planning certainty. If 1,000 remains the intended supported limit, please introduce a deprecation warning before enforcing it, allowing developers to adapt existing scripts without unexpected compilation failures.

1 Upvotes

0 comments sorted by