Limits & safety
What a TapeScript can and cannot do, size limits, error types and messages, and behaviour on venues with less data.
What a script cannot do
- Access the network, files, the clipboard, or browser or desktop features.
- Place, modify or cancel orders.
- Use names other than the built-ins and its own declarations.
A script can only draw on the chart, write to the Console and play alerts.
Size limits
| Limit | |
|---|---|
| Array | 10,000 items |
| Object | 10,000 keys |
| String | 10,000 characters |
| Nested function calls | 64 |
| Script file | 200 KB |
box per market update | 2,000 |
Running hline lines | 200 |
@history | 4 hours |
A script that does too much work on one market update, or creates too much data at once, is stopped with a message and the line number. A common cause is a loop over a large array on every trade. Use the rolling windows or move the work to onInterval.
Growing data
A script that keeps adding entries to an object or array without removing them is stopped with the message "Script state grew too large — clear old entries with remove()". Delete entries that are no longer needed:
function onDepth(side, price, size, time) {
if (size === 0) remove(levels, "" + price)
else levels["" + price] = size
}
Data kept per order id grows the same way. Remove the entry on CANCEL, and on FILL once orders.has(id) is false; clear everything on RESET.
Errors
| Type | Cause | Result |
|---|---|---|
| Error before start | Unknown name, syntax error, wrong directive | The script does not start. The line is highlighted in the editor. |
| Error while running | Wrong type, wrong index, a limit exceeded | The script stops. The message and line are shown in the Console. |
| Not responding | The script stopped responding | The script stops with stopped: unresponsive. |
A stopped script stays stopped until you run it again or re-add it. Other scripts and the chart are not affected.
Venues
Scripts work on all venues supported by the tick heatmap. If a venue does not provide the aggressor side or order-book data, that data is missing. See Venue data.
Availability
TapeScript runs in the Tape Delta desktop app and is free for all signed-in accounts. The web terminal keeps released scripts in your layouts but does not run them.