talib.ema window (see Messages) are checked earlier.
Messages
- History: The script is trying to access historical data outside allowed range (501). The allowed range is 0 to 500.
close[501]compiles and then stops; so doestalib.sma(close, 600), with the length in the brackets.talib.ema,macd,bbw,kcandkcwrefuse such a length already when the script is added to the chart. - Arrays: Array size exceeds the maximum allowed length of 10000 (requested 10001). A
staticarray grows on every bar unless you trim it.array.fromwith too many arguments stops with Error inarray.from(): too many arguments: 4001 (max 4000). - Polylines: a points array of more than 1000 (or none) makes
polyline.newreturnna, with no error; keep the array at or under 1000 points. - Text: String is too long (1000 characters). Maximum length is 999. A long literal still compiles.
- Title: String is too long (130 characters). Maximum length is 128. Only
indicator()checks its title. - Strategies: Maximum number of open trades (1000) exceeded. Maximum number of pending orders (3000) exceeded. Older closed trades return
nafrom thestrategy.closedtrades_*functions. - Time: Execution cancelled, after 45 seconds. Loops have no iteration cap; this limit is the only stop.
Drawings and tables
Set the limit per kind withmax_lines_count, max_labels_count, max_boxes_count or max_polylines_count on indicator() or strategy() (constant integers). A larger value is clamped without an error; zero or less gives 50. Linefills are fixed at 50.
Going over is not an error: the oldest drawings of the kind are deleted down to the limit, except those a static variable holds directly (see Lines, labels, boxes and polylines). A table occupies its position.* slot: a new table there replaces the old one.