ITMScript
The chart console
Ask the chart console for a study or a screen over one of your lists in plain words, read the card it shows, change it in the builder or undo it, and paste a script from another language.
The chart console takes a request in plain words and changes the chart. It can write a study and a screen over one of your lists. It can also convert a script you paste. This page says what each one does and what the console leaves to you.
Open the console from the chart with the button at the corner or with Ctrl plus J. On a Mac the key is Command plus J. The console is in beta and is open to Pro accounts. On any other account the button is not shown and the key does nothing.
Ask for a study
Describe the study. For example, "z-score of close over 20 bars". The console writes a script, checks it and puts the study on the focused chart. A script that does not compile is reported with its problem.
The script is the same language as the rest of this section. A study written by the console is no different from one you write in the builder.
//@itmscript 2
study("Close z-score", overlay=false)
len = input.int(20, "Length", min=2, max=500)
z = (close - ta.sma(close, len)) / ta.stdev(close, len)
plot(z, "Z-score", color=color.teal)Ask for a screen
A screen is a table with one row for each symbol of a list. Ask for it and name the list. For example, "rank my Tech list by 20 day return". The console writes the screen, checks it and puts it on the focused chart. Each column is written for one symbol on the daily clock.
- Name one of your own lists. If you do not name one, or two lists share the name, the console asks which one you mean.
- The console knows the name of each of your lists and how many symbols it holds. It does not list the symbols itself and does not guess them. A list whose name the console could not show you is asked about, never guessed.
- A sector, an index or a group you have not saved as a list is not available. The console says that there is no membership data.
The study card
Each study the console adds comes with a card under its reply. The card is the record of what was added.
- The title is the console's name for the study. Left unnamed, it is taken from the formula.
- The formula shows what the study computes, in short lines.
- Details opens the inputs, the evaluation and the outputs. The inputs list each value the study reads and where it comes from. The evaluation lists the warm-up, the first value and how the history was seeded. A fact that is not known yet reads pending.
- On a study that came from a pasted script, Details also opens the conversion. It has one row for each line the converter reported, the same rows as the Import view in the builder. A row gives the line number, whether the line was converted, converted with a note, refused or dropped, the ITMScript it became, and the note. A refused row carries its code and the rewrite.
- Problems print above the rows and stay there.
The card shows only what the chart has recorded. It does not estimate.
Change it or take it back
- Open in builder opens the builder on this study. Inputs, the script and the placement are edited there, and the chart follows as you edit.
- Undo removes the study, or puts back the script it replaced. Undo works from the newest change to the oldest. An older change waits until the newer ones are undone.
- Undo turn takes back everything one request changed.
You can also ask for a change. "Make the length 30" sets the input. A value is held to the bounds the input declares.
Paste a script
Paste a Pine Script or thinkScript study into the console. A pasted script is taken as code when it has several lines and is in a language the converter reads. The Migrate group names them. The console converts it on your device, with the same converter as the Import view in the builder. The same script always gives the same result. The converter is in beta. The report is the last word on a script.
- The reply gives the counts. It says how many lines the script had and how many were refused.
- A refused line is kept in the study as a comment. The comment carries the code and the rewrite that would let the line through.
- The study is added to the chart with a card, as for any other study.
- A refused row has the button Send this line to the assistant while the assistant is open to you. It replaces the text in the message box with one thing: the line as you pasted it, then the code in square brackets, then the first sentence of the rewrite. It focuses the box and sends nothing. Nothing else of the pasted script goes with it. Edit the text and send it when you choose.
A script that the converter cannot read is not converted. A script it refuses as a whole, such as a library, is not added to the chart either. The reply names the reason. Where the script can be read, the reply points to Import in the builder, which shows the full report line by line. The Migrate group in the side navigation has a page for each language, with the tables of what converts and what does not.
What the console does not do
- It does not read the source of a study that is already on the chart. Open the study in the builder to read it.
- It does not set the symbol or the timeframe of a study. The symbol and timeframe inputs are set on the chart.
- It does not run a study the language refuses. The error codes page lists every refusal and what to write instead.
Where to go next
The builder edits any study as text or as blocks. A tour of the language covers each part of a study.