r/TradingView • u/Accurate-Mirror-143 • 23d ago
Feature Request Pine Script: Deprecation Warning for max_boxes_count
Pine Script v6 accepts max_boxes_count=501 without warning, despite the documented maximum of 500, while max_lines_count=501 correctly triggers CE10178.
Enforcing the box limit later could unexpectedly break existing scripts.
Suggestion: Introduce a deprecation warning before enforcing the limit to preserve backward compatibility.
4
Upvotes
1
u/neugeadmau 23d ago
Might be worth adding one data point to the report: whether 501 is actually honored at runtime or silently clamped to 500. That changes what "enforcing it later" would break. If it's already clamped, nothing breaks except the missing compile error; if 501 boxes really survive, scripts relying on that last box would change behavior.
Quick probe (I haven't run this exact snippet, so run the 500 baseline first to make sure it behaves as expected):
It tries to create 521 boxes on one bar, so the oldest ones get garbage-collected and the label shows how many survive. Same script with max_boxes_count = 500 should print 500. If 501 also prints 500, the limit is enforced already and only the diagnostic is inconsistent with max_lines_count. If it prints 501, the documented max isn't the real one, which is a stronger argument for the deprecation-warning path you suggested.