Docs·TapeScript

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
Array10,000 items
Object10,000 keys
String10,000 characters
Nested function calls64
Script file200 KB
box per market update2,000
Running hline lines200
@history4 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:

JavaScript
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

TypeCauseResult
Error before startUnknown name, syntax error, wrong directiveThe script does not start. The line is highlighted in the editor.
Error while runningWrong type, wrong index, a limit exceededThe script stops. The message and line are shown in the Console.
Not respondingThe script stopped respondingThe 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.