Resources

Every run has a limit

A script cannot run without limits. This page lists the limits of the engine that runs member scripts and what happens when one is reached.

Design limits, not measurements. These are the values built into the engine at the revision named below. A later revision can change them. They say nothing about how long a script takes.

Limits of the engine
LimitValueAt the limit
History depth, default2,048 barsSeries start at this depth and grow as the script needs.
History depth, cap8,192 barsA read past the cap stops the run, or the compile when the number is written in the script.
Steps per bar500,000The run stops on that bar with a named error. Code E-LIMIT-OPS.
Steps per run600,000,000All bars added together, plus work done once for the run. Code E-LIMIT-OPS.
Wall clock of an indicator run5 secondsA watchdog stops the run. Code E-LIMIT-TIME.
Wall clock of a strategy test30 secondsA watchdog stops the test. Code E-LIMIT-TIME.
Logical memory held128 MiBCounted in logical bytes, not host memory. The run stops with a named error.
Logical memory built over a run2 GiBCatches loops that build and drop memory again and again.
Elements in a collection100,000An array, map or matrix larger than this stops the run. Code E-LIMIT-ITEMS.
Length of a text1,000,000In characters. Code E-LIMIT-TEXT.
Call depth64Functions called inside one another. Code E-LIMIT-DEPTH.
Libraries per script64Every import counts, including those inside libraries. Code E-IMPORT-COUNT.
Symbol and timeframe pairs read20On a chart. Code E-REQ-LIMIT.
Alerts per bar20Further alerts on the bar are dropped.
Source size400,000In characters. Code E1090.
Line length20,000In characters. Code E1092.
Problems reported per compile50Reporting stops there. Code E2099.

Where the values come from

Every value is read from the engine's own exporter at engine production@9a82bf9, the revision that serves member scripts (commit of ).

What a stop looks like

A run that reaches a limit stops at the same place each time, with a code, the bar and the line. Nothing is dropped silently. The codes are in the error index.