> ## Documentation Index
> Fetch the complete documentation index at: https://gocharting.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Limits

> Every limit the Lipi compiler and runtime enforce, with the phase that enforces it and the message you see.

Most limits are met while the script runs, so a script can pass every check and then stop on a bar. Only the title limit and the `talib.ema` window (see Messages) are checked earlier.

| Limit | Value | Enforced |
| - | - | - |
| History: `x[n]` and `talib` window lengths | 0 to 500 bars | Runs |
| Elements in an array | 10000 | Runs |
| Arguments of `array.from` | 4000 (999 for strings and other types) | Runs |
| Vertices in one polyline | 1000 | Runs, `polyline.new` gives `na` |
| Text of a label, box or table cell, and its tooltip | 999 characters | Runs |
| `indicator()` title and `shorttitle` | 128 characters | Adding to the chart |
| Drawings of one kind | 50 default, up to 500 (polylines 100) | Runs, by trimming |
| Tables | 9, one per `position.*` | Runs, by replacing |
| Open entries, queued orders, closed-trade detail | 1000, 3000, 1000 | Runs |
| Run time over history | 45 seconds | Runs |

## 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 does `talib.sma(close, 600)`, with the length in the brackets. `talib.ema`, `macd`, `bbw`, `kc` and `kcw` refuse 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 `static` array grows on every bar unless you trim it. `array.from` with too many arguments stops with Error in `array.from()`: too many arguments: 4001 (max 4000).
* Polylines: a points array of more than 1000 (or none) makes `polyline.new` return `na`, 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 `na` from the `strategy.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 with `max_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](https://gocharting.com/docs/scripting/chart-output/drawings.md)). A table occupies its `position.*` slot: a new table there replaces the old one.

## Not limited

The compiler sets no limit on script length or on the number of variables, inputs or plots.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.