ITMScript
Cookbook
Twenty complete studies to paste into the editor, each with what it draws and which inputs to change.
Each recipe is one complete study. Paste it into the editor, add it to the chart and change its inputs. Every block on these pages is compiled by the same checks the chart uses, so each one is accepted as written.
A recipe page has four parts. A sentence says what the study is for. The study follows. What you see says what the chart draws, in plain words. Change these inputs names each input and says what moving it does.
Trend and momentum
- Mark a moving average cross puts a triangle on the bar where two averages cross.
- Show RSI with levels and a zone tint tints the background beyond each level.
- Colour a MACD histogram by its sign picks a colour for each bar of the histogram.
- Colour a trend line by its direction draws an average in one colour while it rises and another while it does not.
Bands and channels
- Draw Bollinger bands with a filled channel fills the space between the bands.
- Find a Keltner squeeze holds a flag on with
latch. - Draw VWAP bands over the whole run draws two pairs of bands around a volume-weighted average.
State carried from bar to bar
- Compute a Heikin-Ashi open uses
scanfor a value that depends on the bar before. - Trail a stop on both sides of price uses
scanwith three branches. - Track the session high restarts a
scanon each session. - Count bars since a cross restarts a
scanon a condition.
Risk and volatility
- Measure realised volatility annualises the spread of returns.
- Chart drawdown from the running peak shows how far the close sits below its high.
Other symbols and timeframes
- Measure relative strength against SPY divides one close by another.
- Measure rolling correlation with SPY compares two sets of returns.
- Measure rolling beta to SPY measures how far one moves for each move of the other.
- Read the daily ATR on an intraday chart reads a coarser timeframe.
- Draw pivot levels from the previous day reads the last finished day.
Tables
- List the crosses in a table records a row for each cross.
- Screen a list of symbols keeps the symbols that pass a condition. Screens are in beta.
Where to go next
A tour of the language explains each part a recipe uses. Outputs covers what a study can draw. The operator reference lists every operator with its parameters.