Learn

Limits and honest notes

What a script can and cannot do in this release, said plainly.

Private, in your browser

Scripts are private to your account and, in this release, run in your browser only. Sharing is not available.

What is not switched on

Script alerts on your own scripts are not switched on for members in this release. No script can place real orders: there is no live trading and no broker connection. The full list is in the wiki: What is not available yet.

The Strategy Lab

Members can test a strategy in the chart's Strategy Lab. On the free chart plan it has 10 runs a month on up to 92 days of history. It runs a strategy over history and reports its trades. See Testing in the Strategy Lab.

Traps in the editor

When you type a script by hand, the editor does not indent the line after the header for you. The header lines such as edition and display must be indented by four spaces; without them the editor reports E3102 and its suggested fix does not help. Pasting a sample avoids this.

The chart's legend and the list of your scripts show the script name from the name field at the top of the editor, not the name in the header line. A new script is called My indicator until you type a name there and press Save.

Results can be wrong

A script computes what its code says, on the data the chart has. That can differ from what you meant. Nothing a script draws is financial advice.

Editions

Write edition = 1 in the header of every script. It names the edition of the language the script is written for, so that a later edition can change the language without changing what an old script means.

Replay and time

Cuprel is designed for deterministic replay: the same data and the same settings are meant to give the same results when a run is repeated. A script reads the time of the bar, not the time of the machine. A mark that depends on later bars, such as a swing pivot, is known only after those bars have closed. More on replay.

Source conversion

The editor has an experimental source conversion for a limited subset of scripts written for other platforms. Only a small tested subset converts; anything else is refused with a reason, and a refused script is not saved. See Import.

Limits of a run

Every run is bounded. A script that reaches a limit stops with a code, the bar and the line; nothing is dropped silently. These are design limits of the engine at production@9a82bf9, not measurements of speed.

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.
Wall clock of an indicator run5 secondsA watchdog stops the run. Code E-LIMIT-TIME.
Logical memory held128 MiBCounted in logical bytes, not host memory. The run stops with a named error.
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.
Source size400,000In characters. Code E1090.
Line length20,000In characters. Code E1092.

All limits are on Resources; every code is in the error index. In the wiki: Limits and budgets and The editor.