TapeHawk Docs
Custom indicators

Limits and troubleshooting

What TapeHawk refuses in an indicator script, the common error messages and what they mean, why a script can draw nothing, and what to do when your indicators stop running.

Reading a message

The indicator editor shows the server's own messages: what is wrong, the position (line 3, col 14), and often a hint about what to write instead. The code a message quotes between backticks is your own.

The checker stops at the first problem it finds, so fixing one can reveal the next.

Common errors

The message containsWhat it meansWhat to do
`x` is not declaredA typo, a name used above the line that declares it, a plot name used as a value, or a list word outside a comparison with its own inputCheck the spelling and the order. To use what a plot draws, name the value first and plot the name
there is no function `f`There is no built-in function fSee Functions
`f` needs 2 parameters, got 1f takes a different number of argumentsSee the function's signature
is outside the range 1..4000A window length is outside 1 to 4,000Use a smaller length, or a smaller max on the input
indented with a tabA line is indented with a tabIndent with spaces
this indent level does not match any open blockA line's indentation does not line up with the if it belongs toIndent the body of each if or else by the same amount
comparisons cannot be chainedA chained comparison, a < b < cWrite a < b and b < c
`x` is already declared at linex is declared twiceRename one of them
`x` is a built-in function or is a built-in sourcex is the name of a built-in function or of a source — t, day and vol are sources tooChoose another name
`x` is a language keywordA name you declared is one of var if else and or notChoose another name
`x` is a keyword, not a valueA keyword where a value belongs — usually one side of and, or or a comparison is missingComplete the expression
cannot infer the domain of `p`The checker cannot tell what kind of number plot p holdsAdd , domain price, count, osc100 or zero — see plot
the definition draws nothing, marks nothing, and alerts nothingThe script has no plot or markAdd a plot
a string cannot be used in an expressionText in quotes inside an expressionUse a number, or move the text to a label
unexpected characterA character the language has no use for, such as %, &, ^ or ?See Operators
cannot read … hereA word or symbol in a place where it cannot goCheck the line against the syntax of what it declares
`x` does not exist yet to reassign:= on a name that was not declared with var or inside the statementsDeclare it with var x = … above
is not a statementAn input, plot or alert inside an if — the message names whichMove it out of the if, above the statements for an input
`input` must come above every statementAn input below the first var, if or :=Move every input above the statements
`mark m` needs `@print`, `@book` or `@cell`A mark on the bar clockMarks need an event clock
`f` can only be read under `@print`A trade-clock function in a script on another clockAdd @print at the top, or use a bar-clock function
name is … characters long, limit is 40A name longer than 40 charactersShorten it
compiles, but a condition cannot carry an alertThe script declares an alert, which TapeHawk no longer accepts. The hint says what the script can do instead: on the trade or footprint-column clock the line can become a mark; a candle script cannot announce anything, and an order-book signal cannot carry an alert yetDelete the line — see alert
bars of warm-up and the window tops out at 1000The script needs more than 1,000 bars of warm-up at the largest values its inputs may takeLower the max of inputs used as lengths, or use shorter windows
fuel per run or fuel per eventA bar-clock script asks for more work over the candles it runs on than one script may do, or an event-clock script for more work on a single trade or order-book frame. A footprint-column script with a mark is checked over the two columns each of its checks runsShorten windows, draw fewer lines, or read a narrower range of the order book
indicators, limit isYour account holds as many indicators as it mayDelete one you no longer use, then save again
total indicator costSaving would push the work of all your indicators together past what an account may useShorten windows or delete an old indicator. Saving a cheaper version of a script is always allowed

Limits

A script is refused, with a message, when it goes past any of these:

WhatLimit
The script65,536 bytes
Indicator or value name40 characters
Window length1 to 4,000
Warm-up of a bar-clock script1,000 bars, at the largest values its inputs may take
Choices in a list input20
Array slots, all arrays together4,000
mark declarations in a script8
A mark's cap100 a minute
A mark's title or msg512 bytes and 8 placeholders
Nesting of expressions and if bodies64 deep

Some limits have no fixed number you can plan around, and are set by TapeHawk:

  • The work a script may do in one run: over the candles it is given on the bar clock, on one trade or order-book update, or over the footprint columns a check covers. Long windows, many lines and wide order-book ranges cost more.
  • The work all your indicators may do together, and how many indicators an account holds. Editing an existing indicator into a cheaper one is always allowed, even when the account is over.
  • The size of a script. A very long script is refused when it is checked or saved.

A script that draws nothing

Go through these in order:

  1. Does it compile? When the editor lists an error, the preview keeps showing the last version that compiled, and a script with an error cannot be saved.
  2. Is it on the right panel? A script with @print or @book at the top draws on heatmap panels only — a candles or footprint panel's menu lists it with a note instead. A @book line starts empty and fills in as the book updates, and a @cell script marks only columns that have closed, so the newest bar has none yet — see Your indicator on a chart.
  3. Is the warm-up longer than the history? A line is blank until its windows have filled, at the settings in use — a 200-bar average over the last 150 bars on screen draws nothing. Scroll back to load more bars, or shorten the window. The warm-up the editor reports is counted at the inputs' defaults, so a higher setting on a panel needs more bars.
  4. Are there too many bars on screen? A script can read only so many bars at once — fewer the more lines, windows, sources and array slots it has. Past that its row in the info bar shows a ⚠ asking you to scroll forward or zoom in.
  5. Does it read order flow? delta, cvd and vol need order flow on the panel.
    • A saved indicator that reads any of them loads order flow on the panel it is added to, whatever the domains of its lines.
    • The editor's preview loads order flow for the draft too.
    • Order flow exists only on the timeframes and candle shapes where order-flow indicators draw — see Where an indicator can be drawn — and on a live-only symbol it reaches back only about half an hour — see Recorded symbols and live-only symbols.
  6. Is every value nan? A comparison with nan is false, and a value built on its own prev that starts from nan stays nan — select(close > prev(top), close, prev(top)) never gets going, while max(close, prev(top)) does. Plot the intermediate values one at a time to find where the numbers disappear.
  7. Did the script stop? An array index outside the array, or decay given nan, stops the script as it runs and nothing is drawn. Guard the index or the value with if.

A saved indicator whose script no longer compiles — after a change in the language — is listed in the indicator menu with a note to open the editor and fix it.

When your indicators are not running

A banner at the top of the editor says when TapeHawk is not running the alerts on the indicators you wrote:

  • Alerts on user-written indicators are temporarily switched OFF by an operator, so they do not notify. Your scripts are stored untouched.
  • Under heavy load, a banner says how many alerts on your indicators are temporarily not being evaluated — one for each rule on each market and timeframe it watches. It clears by itself when the load drops.

Your scripts are not changed in either case, but while a banner shows, those rules are not evaluated and send no notifications — see Custom indicators.

On this page