TradingCharts

Limitations

Every hard limit the platform enforces — source size, history depth, compute budgets, drawing caps, collection sizes, backtest and alert limits — with the current values.

Source and compilation

Limit Value
Source size 600 KiB
Imported libraries per script (transitive) 24
Diagnostics per compile no cap — every error and warning is reported
//@version= annotation any integer accepted; the compiler's behaviour does not change by version

Execution

Limit Value
Chart history available to a script 5,000 bars (close[5000] and beyond is na; longer length arguments raise history lookback exceeded)
Full compute (whole history, on start / bar close) 10 s hard timeout
Live tick compute 2 s hard timeout; ticks slower than 150 ms are paced to every 5 s / 30 s / 60 s instead of killed
Loop iterations 100,000 per loop (for / while); the loop exits, the script continues
request.security targets 512 unique (symbol, timeframe) pairs per script
Executions per user 5 custom + community indicators on a chart at a time (built-in indicators are unlimited)

Visuals (per script, oldest object dropped silently when exceeded)

Kind Default max_*_count range
Lines 500 1–500
Labels 500 1–500
Boxes 500 1–500
Polylines 100 1–100
Linefills 500 —
Tables 8 — (20 × 20 cells each)

Output size: one live update (delta) is capped at 256 KB and a snapshot at 4 MB. A script whose drawings exceed that is stopped with a LIMIT error — reduce drawing counts or max_*_count.

Collections

Collection Max size
array 100,000 elements
map 50,000 entries
matrix 1,000 rows × 1,000 columns

Strategies and backtests

Limit Value
Backtest bars 100,000 (deep history is decimated to 6,000 curve points for the report; metrics use every bar)
Bar-magnifier intrabars 200,000 per run
Backtest wall time 60 s, +1 s per 2,500 bars
Concurrent backtests per executor 4 (further requests wait or fail fast)

Alerts

Limit Value
Runaway guard a rule that fires 15 times inside 3 minutes is stopped
only_once rules stop after their first fire
Webhook targets public http(s) hosts only; private / loopback / link-local addresses are rejected
Rules per user, message length no fixed cap today

Accepted but ignored

For compatibility with the reference language these are parsed and have no effect:

  • currency= on strategy() — reports are in the symbol's native currency
  • max_bars_back / max_bars_back() — the runtime always keeps the full loaded history
  • timeframe_gaps= on indicator(), explicit_plot_zorder= (plots already draw in declaration order)
  • request.economic() — compiles with a warning and returns na (no data source yet)

Everything else on strategy() — calc_on_every_tick, calc_on_order_fills, use_bar_magnifier, fill_orders_on_standard_ohlc, margin_long / margin_short, slippage, commission_* — is enforced by the backtester; see Strategies.

See also