The editor
Where indicators are written, tested and saved.
The commands
Next to the name are the script commands, in the order you use them; full screen is at the top. There is no separate Compile: Save and Add to chart do it, after saving.
| Command | What it does |
|---|---|
| Save ⌘ S | Always saves, even with errors. Then it compiles and writes the result in the console. The dot on the icon means there are unsaved changes. On systems other than Mac the shortcut is Ctrl S. |
| Add to chart | Saves and compiles. Without errors it adds the indicator to the active chart, or updates the one already there; with an error the chart doesn’t change. |
| Full screen | The editor covers the charts, to give you room. The same button puts it back. |
Every save that compiles updates the copies of the indicator already on charts, with their settings. If you removed an option from an input.choice, anyone who had chosen it goes back to the default.
The script menu
The arrow at the end of the name row opens the script menu: New indicator, Make a copy, Delete…, Publish to TotalTrade…, this Documentation and, below, your saved indicators, to open with one click. Before you lose unsaved changes, the editor asks.
Suggestions as you type

- As you type, the script’s names, the language keywords and the allowed Python functions appear. After a dot, the members of
ta,math,format,draw,input,plot,request, the candles, price levels, news, lists, dictionaries and your classes. A news item is recognised infor event in news, also withenumerateand in comprehensions, and innews[i]. - Enter or Tab accept, Ctrl Space opens them, Esc closes them.
- When you open a function’s parenthesis its signature appears, with the argument you’ve reached highlighted.

Errors

- Syntax errors, like an unclosed parenthesis, are underlined as you type, with a mark next to the line number. Hover over it to read the message.
- On save the compiler checks everything else: the error goes to the console, with the line, and stays marked on the line until the next edit.
- Errors during the calculation, like a division by zero, appear in the Log tab, with the line. The indicator’s legend only says “Script error”. See Errors and recalculation.
The console
Below the script there are two tabs. To raise them drag the top edge: an error raises them by itself.

- Messages is the editor’s log: every save or publication adds a line with the time, and the error with its line. It keeps the last 100; right-click for “Clear messages”.
- Log shows the
printoutput and the errors of the last calculation of each indicator, on all charts. Each calculation redoes everything, so the lines are replaced instead of repeating.

Reading the built-ins’ code
In the Indicators dialog, a card’s </> button opens the code in the editor as an unsaved copy, “Name (copy)”. “Source code” and “Copy code” in the legend’s More menu do the same. If you save it, it becomes one of your indicators.

Where scripts end up
Saved and without errors, a script is in the catalog, under My indicators. With an error it stays in the editor menu, but leaves the catalog until you fix it. To share it, see Publishing.