ITMScript · Migrate
From Pine Script
How a Pine Script study becomes an ITMScript study, line by line, and which lines are refused and why.
Convert a script
There are two ways in. In the study builder, select Import, leave the language on Auto or choose Pine Script, paste the script and select Convert. Or paste the script into the chart console, which reads it as Pine Script, converts it on your device and adds the study to the chart.
Both use the same converter. It reads the script as text and uses no model, so the same script always gives the same result. The builder page covers the import view.
What you get
A converted study is plain ITMScript. It opens with //@itmscript 2. Each statement is on its own line, in the order of the original. You can read it, change it and add it to the chart like any study you wrote.
A line the converter cannot carry over stays in the study as a comment. The comment starts with // refused, then names the code, the line and what to write instead. The rest of the study still converts, so you can fix the comment by hand.
A line that converts with a difference carries a note in the report. The report lists every line as converted, converted with a note, refused or dropped. A dropped line is one that has no effect on values, such as a log message. Nothing is lost without a note.
What was measured
The converter was measured on 541 original scripts in common shapes, written for this converter, never copied from a published script. 174 converted without a note. 224 converted with at least one note. 143 had at least one refused line.
A count is of scripts. The set includes the shapes that are refused by design, so it is a record of what the converter does and not a promise about your script. The report on your script is the last word.
Same, close, not yet and refused
Each row of the tables below carries one of four words.
- Same
- The numbers agree with the original once the warm-up has passed.
- Close
- The line converts and the report carries a note. Read the note and check the result against the original.
- Not yet
- The language cannot say this today. The line is refused with a code and a rewrite, and a later release may convert it.
- Refused
- ITMScript does not do this by design. The line is refused with a code and a rewrite.
A row describes a name. A name can convert in one shape and be refused in another, so the report is the last word on a script.
Other symbols and timeframes
A call to request.security becomes a declared series. The converter writes a declaration such as d = series(timeframe="1d") once and reads the fields of d where the script read the request. Two requests for the same symbol and timeframe share one declaration. The other data page explains declared series.
A declared series shows the last completed bar. The source script can show the bar that is still forming on a live chart. The report says so in a note on every converted request.
A crossing of the chart and a requested value, such as ta.crossover(close, prevHigh), converts as the difference crossing zero, ta.crossover(close - prevHigh, 0). The difference runs on the chart's bars, where the source crosses. Any other window, read of an earlier bar or running total over a requested value is refused. The source computes it on the chart's bars, and the converted name would read the bars of the requested timeframe. Write the calculation inside the request instead.
A request that reads a bar before it closes is refused. That covers a request with lookahead switched on and no offset, and a request with gaps switched on. A request with lookahead switched on and a one bar offset, such as close[1], reads the day before and converts. The open of a day, a week, a month, three months or twelve months, requested with lookahead switched on, converts to the open of the regular session's first bar of that period. The note on it says which bar that is. The open of a shorter period is refused. A request for bars finer than the chart is refused, because a study runs on the chart's own clock. Financial, economic and earnings requests are refused because they are not price series.
Time and sessions
The calendar fields convert to the field of the same name: time, year, month, dayofmonth, dayofweek, hour, minute and the session.* facts. They follow the exchange calendar of the chart. The time and sessions page says what each one reads.
A volume weighted price that restarts at a period converts with the matching reset. The variable ta.vwap resets on each session in the source, so it is written ta.vwap(hlc3, reset=day) and the report notes that here it resets on each day. The anchor of ta.vwap, written with timeframe.change, converts. A period of a day, a week, a month, three months or twelve months gives reset=day, reset=week, reset=month, reset=quarter or reset=year. A new day, written timeframe.change("D"), converts to session.isfirstbar. It is true on the regular session's first bar on this chart. The test ta.change(time("D")) converts the same way when it is compared with 0 or used as a condition. In any other place, or with a length, it is refused. A new bar of any other timeframe is refused, and so is a read of the chart's own timeframe.
Functions, choices and shifts
A function written on the lines under => converts. A switch or an if inside it converts when every branch gives one value. An arm that draws, assigns or holds a block is refused, and the report names the line. A parameter may carry a default written as a literal: a number, true, false, na, a colour or text. A call may leave that argument out. The type words on a parameter are dropped.
An if chain over a plain variable converts when every branch gives that variable one value. The chain becomes a new name that holds a condition for each branch, with the earlier value when no branch holds, and later lines read the new name. A branch that draws, a name set twice in one branch, or a second name inside a function body is refused. Several names set in one branch convert as one chain each. A := on one name in every arm of a switch converts. The report for a refused block says what converts and names its first row that does not.
A variable set again with := converts. A line above the change that reads the variable's earlier value, such as x[1], is refused, because the source reads the value after the change.
A text input with a list of options becomes a choice input. A switch or an if over it becomes a chain of comparisons with the options, in order, with the default as the last branch. A choice compares with one of its own options and nowhere else, so a choice read in any other way is refused. A case that is not one of the options is refused as a mistyped line. The colour of a fill may change bar by bar, as the colour of a plot may.
A plot drawn ahead by an input converts, and so does a shift written as arithmetic over int inputs, such as offset=ahead - 1. The converter narrows the range of the input so the shift stays from 0 to 500, and the report names a bound of the script that it moves. A shift that works out outside that range at the defaults of its inputs is refused. A shift from a float input or from a series is refused. A shift backward is refused, except the mark of a pivot drawn back by the pivot's own length, which is drawn on the bar that confirms the pivot with a note that says so. To use a value from n bars ago, write x[n]. A signed bound on an input is kept, so minval=-100 becomes min=-100.
Refused by design
Some lines are refused because ITMScript does not do what they ask, not because the converter is incomplete. Each has a code, a meaning and a rewrite. The codes also appear on the error codes page.
- Strategies. A strategy places simulated orders. A study draws an indicator and never trades. Convert the indicator logic and mark entries and exits with markers or alerts.
- Drawings. Labels, lines, boxes and tables at chart coordinates have no equivalent. A study produces series and markers.
- Shifts backward. A plot is drawn at the bar that computed it or ahead of it, never behind it. The mark of a pivot is the one exception, as above. Read an earlier value with
x[n]. - Lookahead and repainting. A script that reads a bar before it closes, or a value that changes after the bar, cannot be reproduced. ITMScript reads history backward only.
- Loops with no fixed bound and state between ticks. The work of a study must be known before it runs. Use a rolling operator with a fixed window.
- Arrays, matrices and maps. They hold state that the language does not model. A rolling window over the series replaces most uses.
| Code | What the line does | What to write instead |
|---|---|---|
convert-parse | The line could not be read as a statement of the source language. | Check the line for a typo, or write it by hand in ITMScript. |
convert-strategy | A strategy places simulated orders. An ITMScript study draws an indicator and never trades. | Convert the indicator logic as a study. Mark entries and exits with plotshape or alertcondition. |
convert-drawing | Labels, lines, boxes and tables drawn at chart coordinates have no equivalent. A study produces series and markers. | Plot the level as a series with plot or hline. Use value or events for a table of numbers. |
convert-lookahead | The script reads a bar that has not closed yet. ITMScript reads history backward only. | Read the previous bar with x[1] and accept the one bar delay. |
convert-varip | A varip variable keeps state between ticks inside a bar. The result depends on the tick feed and cannot be reproduced. | Compute the value once per bar. Use ta.* operators and x[1] for history. |
convert-loop-unbounded | The loop has no fixed bound, so its work cannot be limited before it runs. | Use a rolling operator with a fixed window, such as ta.sma(x, N) or ta.highest(x, N). |
convert-collection | Arrays, matrices and maps hold state that ITMScript does not model. | Use a rolling window over the series. For example ta.highest(x, N) replaces a scan of an array of the last N values. |
convert-string-op | String arithmetic and string comparison are not part of ITMScript. Text is used for titles and labels only. | Compare numbers or conditions instead of text. Keep text for titles and labels. |
convert-security-lookahead | The request reads a higher timeframe bar before it closes. The value changes after the fact. | Declare the series with series(timeframe="1d"). ITMScript reads the last completed bar only. |
convert-security-gaps | The request leaves gaps between updates of another timeframe. ITMScript repeats the last completed bar instead. | Declare the series with series(timeframe=...). It repeats the last completed bar between updates. |
convert-security-lower-tf | The request asks for bars finer than the chart. A study runs on the chart clock. | Run the study on the finer chart and declare the coarser series with series(timeframe=...). |
convert-request-feed | The request asks for data that is not a price series, such as financials, economic series or earnings. | Use a price series declared with series(symbol=...), or enter the value as an input.float. |
convert-series-length | A window length that changes from bar to bar cannot size the state of an operator. | Use a constant or an input for the length, for example len = input.int(14). |
convert-plot-offset | A plot shifts ahead by a whole number of bars from 0 to 500, written in the call or given by an int input and arithmetic over int inputs. A shift backward draws a later bar's value on an earlier bar, which this language cannot draw, and a shift on any output but plot is not carried. | Write the shift as a number or an int input on the plot. For a value from n bars ago, read it with x[n]. A plot shifted back has no form. |
convert-dynamic-offset | A history offset that changes from bar to bar cannot be bounded before the run. | Use a constant or an input for the offset, for example x[len] with len = input.int(5). |
convert-dynamic-text | Text built from values at run time, such as a label that shows a price, is not supported. | Plot the number. Use value for a single readout. |
convert-host-visual | Candle, bar and price colouring replace the drawing of the chart itself. A study adds series and markers on top of it. | Use plotshape markers, or tint the background with bgcolor. |
convert-nondeterministic | Random numbers, the wall clock and other values that differ between runs break reproducibility. | Remove the value, or replace it with a fixed input. |
convert-instrument-meta | Facts about the instrument, such as tick size, point value or currency, are not available to a study. | Enter the value as an input.float and set it for the instrument. |
convert-unknown-call | The function or variable has no equivalent in the converter tables. | Write the calculation with ITMScript operators, or remove the line. |
convert-library | A library declaration or an import brings code from another script. | Paste the library's functions into the script, or write them as functions. |
convert-period-open | A period's own open, high, low or close read without an offset is the forming period's value, which this language cannot state exactly on this chart. | Read the closed period with a shift of one, for example d.close[1]. |
convert-limit | The script is larger or more deeply nested than the converter accepts. | Split the script into smaller studies and convert each one. |
Examples
Each example is a script run through the converter. The left side is the script as written. The right side is what the converter wrote, unedited.
The close of the day before
A request for the daily close, offset by one bar, becomes a read of one declared daily series. The note says where the two differ.
//@version=5
// The close of the day before, read with the lookahead option on, on an intraday chart.
indicator("Prior day close", overlay=true)
priorClose = request.security(syminfo.tickerid, "D", close[1], lookahead = barmerge.lookahead_on)
plot(priorClose, "Prior day close", color=color.orange)//@itmscript 2
study("Prior day close", overlay=true)
d = series(timeframe="1d")
priorClose = d.close
plot(priorClose, "Prior day close", color=color.orange)Report: 2 converted, 1 with a note, 0 refused, 0 dropped.
- On the last bar of each day the series moves on to the day that has just closed. The source is still one day behind. The mapping assumes a chart finer than 1d.
A volume weighted price that restarts each day
The average restarts each day in the source, so the converted call is written with reset=day.
//@version=5
// A volume weighted price on an intraday chart.
indicator("Daily weighted price", overlay=true)
vw = ta.vwap(hlc3)
plot(vw, "Weighted price", color=color.orange)//@itmscript 2
study("Daily weighted price", overlay=true)
vw = ta.vwap(hlc3, reset=day)
plot(vw, "Weighted price", color=color.orange)Report: 1 converted, 1 with a note, 0 refused, 0 dropped.
- The source resets the average on each session. Here it resets on each day.
A timeframe chosen by an input
An input that picks the timeframe feeds a declared series. The input stays an input and the series follows it.
//@version=5
// The close of the last completed bar of a timeframe chosen by an input, read with the lookahead option on.
indicator("Prior close, chosen timeframe", overlay=true)
tf = input.timeframe("D", "Timeframe")
priorClose = request.security(syminfo.tickerid, tf, close[1], lookahead=barmerge.lookahead_on)
plot(priorClose, "Prior close", color=color.orange)//@itmscript 2
study("Prior close, chosen timeframe", overlay=true)
tf = input.timeframe("1d", "Timeframe")
tf_bars = series(timeframe=tf)
priorClose = tf_bars.close
plot(priorClose, "Prior close", color=color.orange)Report: 2 converted, 2 with a note, 0 refused, 0 dropped.
- The frequency of a series is an input here. The chart has to serve the frequency that is chosen.
- On the last bar of each period the series moves on to the period that has just closed. The source is still one period behind. The mapping assumes a chart finer than the chosen frequency.
A switch over a choice
A text input with a list of options becomes a choice. A switch on it becomes a chain of comparisons with the options, and the default is the last branch.
//@version=5
// A switch over a text choice picks the kind of average, with a plain close as the default.
indicator("Average by kind", overlay=true)
kind = input.string("Weighted", "Kind", options=["Simple", "Exponential", "Weighted"])
span = input.int(34, "Span", minval=2)
trend = switch kind
"Simple" => ta.sma(close, span)
"Exponential" => ta.ema(close, span)
"Weighted" => ta.wma(close, span)
=> close
plot(trend, "Trend", color=color.navy)//@itmscript 2
study("Average by kind", overlay=true)
kind = input.choice("Weighted", ["Simple", "Exponential", "Weighted"], "Kind")
span = input.int(34, "Span", min=2, max=10000)
trend = kind == "Simple" ? ta.sma(close, span) : (kind == "Exponential" ? ta.ema(close, span) : (kind == "Weighted" ? ta.wma(close, span) : close))
plot(trend, "Trend", color=color.navy)Report: 2 converted, 2 with a note, 0 refused, 0 dropped.
- A text input with a list of options became a choice input. It compares with one of its options, and the comparison picks a value.
- The average starts from the mean of the first window. The source script starts from the first value. Later values agree. For the same start, use
ta.ewm(x, 2 / (len + 1)).
A function written under the arrow
A function written on the lines under => converts, and so does the switch inside it. The choice is passed in as an argument.
//@version=5
// A function picks the kind of average with a switch over the choice it is given. The dropdown is passed in as an argument.
indicator("Chosen average band", overlay=true)
kind = input.string("EMA", "Average", options=["SMA", "EMA", "RMA", "WMA"])
len = input.int(20, "Length", minval=2)
width = input.float(2.0, "Width", minval=0.1)
average(source, length, mode) =>
switch mode
"SMA" => ta.sma(source, length)
"EMA" => ta.ema(source, length)
"RMA" => ta.rma(source, length)
=> ta.wma(source, length)
basis = average(close, len, kind)
spread = width * ta.stdev(close, len)
plot(basis, "Basis", color=color.blue)
plot(basis + spread, "Upper", color=color.gray)
plot(basis - spread, "Lower", color=color.gray)//@itmscript 2
study("Chosen average band", overlay=true)
kind = input.choice("EMA", ["SMA", "EMA", "RMA", "WMA"], "Average")
len = input.int(20, "Length", min=2, max=10000)
width = input.float(2.0, "Width", min=0.1)
average(source, length, mode) => mode == "SMA" ? ta.sma(source, length) : (mode == "EMA" ? ta.ema(source, length) : (mode == "RMA" ? ta.rma(source, length) : ta.wma(source, length)))
basis = average(close, len, kind)
spread = width * ta.stdev(close, len)
plot(basis, "Basis", color=color.blue)
plot(basis + spread, "Upper", color=color.gray)
plot(basis - spread, "Lower", color=color.gray)Report: 7 converted, 2 with a note, 0 refused, 0 dropped.
- A text input with a list of options became a choice input. It compares with one of its options, and the comparison picks a value.
- The average starts from the mean of the first window. The source script starts from the first value. Later values agree. For the same start, use
ta.ewm(x, 2 / (len + 1)).
Typed parameters and a default
The type words are dropped. A parameter default is kept, and a call may leave that argument out.
//@version=5
// A helper whose parameters carry a qualifier and a type, the last one with a default.
indicator("Typed helper parameters", overlay=false)
spread(series float a, series float b, simple int n, series float gain = 1.0) =>
gain * (ta.sma(a, n) - ta.sma(b, n))
plot(spread(close, open, 14), "Spread", color=color.teal)
plot(spread(high, low, 14, 0.5), "Half range", color=color.gray)//@itmscript 2
study("Typed helper parameters", overlay=false)
spread(a, b, n, gain=1.0) => gain * (ta.sma(a, n) - ta.sma(b, n))
plot(spread(close, open, 14), "Spread", color=color.teal)
plot(spread(high, low, 14, 0.5), "Half range", color=color.gray)Report: 3 converted, 0 with a note, 0 refused, 0 dropped.
An if chain over a plain variable
Each branch sets the same name. The chain becomes one new name that holds a condition for each branch, and later lines read the new name. With no else, the name keeps its earlier value.
//@version=5
// A name set by an if chain at the top level. With no else the name keeps its earlier value.
indicator("Gap direction")
float dir = 0
if close > high[1]
dir := 1
else if close < low[1]
dir := -1
plot(dir, "Gap direction", color=color.orange)
plot(ta.ema(dir, 5), "Smoothed", color=color.purple)//@itmscript 2
study("Gap direction", overlay=false)
dir = 0
dir2 = close > high[1] ? 1 : (close < low[1] ? -1 : dir)
plot(dir2, "Gap direction", color=color.orange)
plot(ta.ema(dir2, 5), "Smoothed", color=color.purple)Report: 3 converted, 1 with a note, 0 refused, 0 dropped.
- The average starts from the mean of the first window. The source script starts from the first value. Later values agree. For the same start, use
ta.ewm(x, 2 / (len + 1)).
A shift from an input
A plot drawn ahead by an input, or by arithmetic over it, converts. The colour of the fill follows the bars. A shift backward has no form, so that plot is refused and the rest converts.
//@version=5
// Two lead lines drawn ahead by an input, the band between them, and a lag line that would be drawn back.
indicator("Lead band by input", overlay=true)
fastLen = input.int(10, "Fast")
slowLen = input.int(30, "Slow")
ahead = input.int(26, "Bars ahead")
mid(n) => math.avg(ta.lowest(low, n), ta.highest(high, n))
leadA = math.avg(mid(fastLen), mid(slowLen))
leadB = mid(slowLen)
pa = plot(leadA, "Lead A", color=color.green, offset=ahead - 1)
pb = plot(leadB, "Lead B", color=color.red, offset=ahead - 1)
fill(pa, pb, color=leadA > leadB ? color.new(color.green, 85) : color.new(color.red, 85))
plot(close, "Lag", color=color.gray, offset=-ahead + 1)//@itmscript 2
study("Lead band by input", overlay=true)
fastLen = input.int(10, "Fast")
slowLen = input.int(30, "Slow")
ahead = input.int(26, "Bars ahead", min=1, max=500)
mid(n) => math.avg(ta.lowest(low, n), ta.highest(high, n))
leadA = math.avg(mid(fastLen), mid(slowLen))
leadB = mid(slowLen)
pa = plot(leadA, "Lead A", color=color.green, offset=ahead - 1)
pb = plot(leadB, "Lead B", color=color.red, offset=ahead - 1)
fill(pa, pb, color=leadA > leadB ? color.new(color.green, 85) : color.new(color.red, 85))
// refused convert-plot-offset: plot(close, "Lag", color=color.gray, offset=-ahead + 1). A plot is not drawn back. Draw the mark on the bar that confirms it, without the offset, or read the earlier value with x[n].Report: 9 converted, 0 with a note, 1 refused, 0 dropped.
- A shift is a whole number from 0 to 500 at the defaults of its inputs, and this one is not known.
An input with a negative bound
A range that runs below zero is kept as written.
//@version=5
// An input whose range runs below zero, kept as written.
indicator("Signed input range", overlay=false)
bias = input.int(-25, "Bias", minval=-100, maxval=0)
plot(ta.roc(close, 10) + bias, "Biased change", color=color.teal)//@itmscript 2
study("Signed input range", overlay=false)
bias = input.int(-25, "Bias", min=-100, max=0)
plot(ta.roc(close, 10) + bias, "Biased change", color=color.teal)Report: 2 converted, 0 with a note, 0 refused, 0 dropped.
A strategy
Orders are refused. The indicator logic around them still converts.
//@version=5
// A crossing system that places orders.
strategy("Crossing system", overlay=true)
fast = ta.sma(close, 10)
slow = ta.sma(close, 30)
strategy.entry("Long", strategy.long, when=ta.crossover(fast, slow))
plot(fast, "Fast")
plot(slow, "Slow")//@itmscript 2
study("Crossing system", overlay=true)
// refused convert-strategy: strategy("Crossing system", overlay=true). Convert the indicator logic as a study. Mark entries and exits with `plotshape` or `alertcondition`.
fast = ta.sma(close, 10)
slow = ta.sma(close, 30)
// refused convert-strategy: strategy.entry("Long", strategy.long, when=ta.crossover(fast, slow)). Convert the indicator logic as a study. Mark entries and exits with `plotshape` or `alertcondition`.
plot(fast, "Fast")
plot(slow, "Slow")Report: 4 converted, 0 with a note, 2 refused, 0 dropped.
strategycannot be converted. A strategy places simulated orders. An ITMScript study draws an indicator and never trades.strategy.entrycannot be converted. A strategy places simulated orders. An ITMScript study draws an indicator and never trades.
Functions and names
Every function and built-in name the converter knows. A call has arguments. A name is read as it stands.
| Pine Script | Form | Becomes | Match | Note |
|---|---|---|---|---|
ta.accdist | Name | ta.accdist() | Same | |
ta.iii | Name | ta.iii() | Same | |
ta.nvi | Name | ta.nvi() | Same | |
ta.obv | Name | ta.obv() | Same | |
ta.pvi | Name | ta.pvi() | Same | |
ta.pvt | Name | ta.pvt() | Same | |
ta.wad | Name | ta.wad() | Same | |
ta.wvad | Name | ta.wvad() | Same | |
ta.tr | Name | ta.tr() | Same | |
ta.tr | Call | ta.tr | Same | |
ta.alma | Call | ta.alma | Close | The floor option is not supported. A script that turns it on is refused. |
ta.atr | Call | ta.atr | Same | |
ta.barssince | Call | ta.barssince | Same | |
ta.bb | Call | ta.bb | Same | |
ta.bbw | Call | ta.bbw | Same | |
ta.cci | Call | ta.cci | Same | |
ta.change | Call | ta.change | Close | A change of a condition was written as ta.change(cond ? 1 : 0, len) != 0. A change of a text value is not supported. |
ta.cmo | Call | ta.cmo | Same | |
ta.cog | Call | ta.cog | Same | |
ta.correlation | Call | ta.correlation | Same | |
ta.cross | Call | ta.cross | Same | |
ta.crossover | Call | ta.crossover | Same | |
ta.crossunder | Call | ta.crossunder | Same | |
ta.cum | Call | ta.cum | Same | |
ta.dev | Call | ta.dev | Same | |
ta.dmi | Call | ta.dmi | Same | |
ta.ema | Call | ta.ema | Close | The average starts from the mean of the first window. The source script starts from the first value. Later values agree. For the same start, use ta.ewm(x, 2 / (len + 1)). |
ta.falling | Call | ta.falling | Close | This language tests that the series fell on each of the last N bars. The source script may test the current value against the window. Check the result against the original. |
ta.highest | Call | ta.highest | Same | |
ta.highestbars | Call | ta.highestbars | Close | The source script returns a negative offset. This language counts bars as a positive number. The sign was flipped. |
ta.hma | Call | ta.hma | Same | |
ta.kc | Call | ta.kc | Close | With the true range switched off, the width of the channel is the smoothed average of high minus low. A gap between bars does not widen it. |
ta.kcw | Call | ta.kcw | Close | With the true range switched off, the width is written out from its definition, because the operator has no such option. |
ta.linreg | Call | ta.linreg | Same | |
ta.lowest | Call | ta.lowest | Same | |
ta.lowestbars | Call | ta.lowestbars | Close | The source script returns a negative offset. This language counts bars as a positive number. The sign was flipped. |
ta.macd | Call | ta.macd | Close | The averages inside start from the mean of the first window. The source script starts from the first value. Early values can differ. Later values agree. |
ta.max | Call | ta.max | Same | |
ta.median | Call | ta.median | Same | |
ta.mfi | Call | ta.mfi | Same | |
ta.min | Call | ta.min | Same | |
ta.mode | Call | Not converted | Not yet | Write the calculation with ITMScript operators, or remove the line. convert-unknown-call |
ta.mom | Call | ta.mom | Same | |
ta.percentile_linear_interpolation | Call | ta.percentile_linear_interpolation | Same | |
ta.percentile_nearest_rank | Call | ta.percentile_nearest_rank | Same | |
ta.percentrank | Call | ta.percentrank | Same | |
ta.pivot_point_levels | Call | Not converted | Not yet | Declare d = series(timeframe="1d") and write the levels from d.high, d.low and d.close. convert-unknown-call |
ta.pivothigh | Call | ta.pivothigh | Same | |
ta.pivotlow | Call | ta.pivotlow | Same | |
ta.range | Call | ta.highest | Close | The range of a series over a window is the highest value minus the lowest value. It was written that way. |
ta.rci | Call | ta.rci | Same | |
ta.rising | Call | ta.rising | Close | This language tests that the series rose on each of the last N bars. The source script may test the current value against the window. Check the result against the original. |
ta.rma | Call | ta.rma | Same | |
ta.roc | Call | ta.roc | Same | |
ta.rsi | Call | ta.rsi | Close | The smoothing of gains and losses starts from the mean of the first window. Early values can differ from the source script. Later values agree. |
ta.sar | Call | ta.sar | Same | |
ta.sma | Call | ta.sma | Same | |
ta.stdev | Call | ta.stdev | Close | The unbiased form was written as ta.stdev(x, len) * math.sqrt(len / (len - 1)). |
ta.stoch | Call | ta.stoch | Close | The source script passes high and low as arguments. This language reads them from the bars. Other series are written out as a formula. |
ta.supertrend | Call | ta.supertrend | Same | |
ta.swma | Call | ta.swma | Same | |
ta.tsi | Call | ta.tsi | Close | This language scales the index by 100. The value was divided by 100 to match the source script. |
ta.valuewhen | Call | ta.valuewhen | Same | |
ta.variance | Call | ta.variance | Close | The unbiased form was multiplied by len / (len - 1). |
ta.vwap | Call | ta.vwap | Close | The source resets the average on each session. Here it resets on each day. |
ta.vwap | Name | ta.vwap(hlc3, reset=day) | Close | The source resets the average on each session. Here it resets on each day. |
ta.vwma | Call | ta.vwma | Same | |
ta.wma | Call | ta.wma | Same | |
ta.wpr | Call | ta.wpr | Same | |
math.abs | Call | math.abs | Same | |
math.acos | Call | math.acos | Same | |
math.asin | Call | math.asin | Same | |
math.atan | Call | math.atan | Same | |
math.ceil | Call | math.ceil | Same | |
math.cos | Call | math.cos | Same | |
math.exp | Call | math.exp | Same | |
math.floor | Call | math.floor | Same | |
math.log | Call | math.log | Same | |
math.log10 | Call | math.log10 | Same | |
math.sign | Call | math.sign | Same | |
math.sin | Call | math.sin | Same | |
math.sqrt | Call | math.sqrt | Same | |
math.tan | Call | math.tan | Same | |
math.todegrees | Call | math.todegrees | Same | |
math.toradians | Call | math.toradians | Same | |
math.pow | Call | math.pow | Same | |
math.avg | Call | math.avg | Close | math.avg takes two arguments here. More were averaged as their sum divided by their count. |
math.max | Call | math.max | Close | math.max takes two arguments here. More were nested. |
math.min | Call | math.min | Close | math.min takes two arguments here. More were nested. |
math.e | Name | math.e() | Close | math.e is a call here. It was written math.e(). |
math.pi | Name | math.pi() | Close | math.pi is a call here. It was written math.pi(). |
math.phi | Name | 1.618033988749895 | Close | math.phi was written as its value. |
math.rphi | Name | 0.6180339887498949 | Close | math.rphi was written as its value. |
math.round | Call | math.round | Close | Halves round away from zero here. A precision was written as a scaling by a power of ten. |
math.atan2 | Call | Not converted | Refused | The source language has no two-argument arctangent, so there is nothing to convert. Write math.atan2(y, x) directly in ITMScript. convert-unknown-call |
math.sum | Call | ta.sum | Close | math.sum is ta.sum here. |
math.random | Call | Not converted | Refused | Remove the value, or replace it with a fixed input. convert-nondeterministic |
math.round_to_mintick | Call | Not converted | Refused | Enter the value as an input.float and set it for the instrument. convert-instrument-meta |
nz | Call | nz | Same | |
na | Call | na | Same | |
fixnan | Call | fixnan | Same | |
open | Name | open | Same | |
high | Name | high | Same | |
low | Name | low | Same | |
close | Name | close | Same | |
volume | Name | volume | Same | |
hl2 | Name | hl2 | Same | |
hlc3 | Name | hlc3 | Same | |
ohlc4 | Name | ohlc4 | Same | |
hlcc4 | Name | (high + low + close + close) / 4 | Close | hlcc4 is not a source field. It was written as (high + low + close + close) / 4. |
bar_index | Name | bar_index | Close | bar_index counts from the first bar of the run, not from the first bar of the chart. |
na | Name | na | Same | |
time | Name | time | Same | |
time_close | Name | Not converted | Not yet | Use a calendar field such as hour or session.ismarket, a reset= word, or one study for each timeframe. convert-calendar |
time_tradingday | Name | Not converted | Not yet | Use a calendar field such as hour or session.ismarket, a reset= word, or one study for each timeframe. convert-calendar |
last_bar_index | Name | Not converted | Refused | Read the previous bar with x[1] and accept the one bar delay. convert-lookahead |
last_bar_time | Name | Not converted | Refused | Read the previous bar with x[1] and accept the one bar delay. convert-lookahead |
barstate.isfirst | Name | bar_index == 0 | Close | barstate.isfirst was written bar_index == 0. The count starts at the first bar of the run. |
barstate.islast | Name | Not converted | Refused | Remove the value, or replace it with a fixed input. convert-nondeterministic |
barstate.islastconfirmedhistory | Name | Not converted | Refused | Remove the value, or replace it with a fixed input. convert-nondeterministic |
barstate.isconfirmed | Name | Not converted | Refused | Remove the value, or replace it with a fixed input. convert-nondeterministic |
barstate.isnew | Name | Not converted | Refused | Remove the value, or replace it with a fixed input. convert-nondeterministic |
barstate.isrealtime | Name | Not converted | Refused | Remove the value, or replace it with a fixed input. convert-nondeterministic |
barstate.ishistory | Name | Not converted | Refused | Remove the value, or replace it with a fixed input. convert-nondeterministic |
timeframe.period | Name | Not converted | Not yet | Use a calendar field such as hour or session.ismarket, a reset= word, or one study for each timeframe. convert-calendar |
timeframe.multiplier | Name | Not converted | Not yet | Use a calendar field such as hour or session.ismarket, a reset= word, or one study for each timeframe. convert-calendar |
timeframe.isseconds | Name | Not converted | Not yet | Use a calendar field such as hour or session.ismarket, a reset= word, or one study for each timeframe. convert-calendar |
timeframe.isminutes | Name | Not converted | Not yet | Use a calendar field such as hour or session.ismarket, a reset= word, or one study for each timeframe. convert-calendar |
timeframe.isintraday | Name | Not converted | Not yet | Use a calendar field such as hour or session.ismarket, a reset= word, or one study for each timeframe. convert-calendar |
timeframe.isdaily | Name | Not converted | Not yet | Use a calendar field such as hour or session.ismarket, a reset= word, or one study for each timeframe. convert-calendar |
timeframe.isweekly | Name | Not converted | Not yet | Use a calendar field such as hour or session.ismarket, a reset= word, or one study for each timeframe. convert-calendar |
timeframe.ismonthly | Name | Not converted | Not yet | Use a calendar field such as hour or session.ismarket, a reset= word, or one study for each timeframe. convert-calendar |
timeframe.isdwm | Name | Not converted | Not yet | Use a calendar field such as hour or session.ismarket, a reset= word, or one study for each timeframe. convert-calendar |
timeframe.main_period | Name | Not converted | Not yet | Use a calendar field such as hour or session.ismarket, a reset= word, or one study for each timeframe. convert-calendar |
timeframe.change | Call | session.isfirstbar | Close | It is true on the regular session's first bar on this chart. The source is true on the first bar of the day, extended hours included. |
timeframe.in_seconds | Call | Not converted | Not yet | Use a calendar field such as hour or session.ismarket, a reset= word, or one study for each timeframe. convert-calendar |
syminfo.tickerid | Name | Not converted | Refused | Declare the symbol with series(symbol=...). convert-instrument-meta |
syminfo.ticker | Name | Not converted | Refused | Declare the symbol with series(symbol=...). convert-instrument-meta |
syminfo.mintick | Name | Not converted | Refused | Enter the value as an input.float and set it for the instrument. convert-instrument-meta |
syminfo.pointvalue | Name | Not converted | Refused | Enter the value as an input.float and set it for the instrument. convert-instrument-meta |
syminfo.currency | Name | Not converted | Refused | Enter the value as an input.float and set it for the instrument. convert-instrument-meta |
syminfo.timezone | Name | Not converted | Refused | Enter the value as an input.float and set it for the instrument. convert-instrument-meta |
syminfo.session | Name | Not converted | Refused | Enter the value as an input.float and set it for the instrument. convert-instrument-meta |
syminfo.type | Name | Not converted | Refused | Enter the value as an input.float and set it for the instrument. convert-instrument-meta |
dayofweek | Name | dayofweek | Same | |
hour | Name | hour | Same | |
minute | Name | minute | Same | |
month | Name | month | Same | |
year | Name | year | Same | |
dayofmonth | Name | dayofmonth | Same | |
weekofyear | Name | Not converted | Not yet | Use a calendar field such as hour or session.ismarket, a reset= word, or one study for each timeframe. convert-calendar |
second | Name | Not converted | Not yet | Use a calendar field such as hour or session.ismarket, a reset= word, or one study for each timeframe. convert-calendar |
dayofweek.sunday | Name | 1 | Same | |
dayofweek.monday | Name | 2 | Same | |
dayofweek.tuesday | Name | 3 | Same | |
dayofweek.wednesday | Name | 4 | Same | |
dayofweek.thursday | Name | 5 | Same | |
dayofweek.friday | Name | 6 | Same | |
dayofweek.saturday | Name | 7 | Same | |
session.ismarket | Name | session.ismarket | Same | |
session.ispremarket | Name | session.ispremarket | Same | |
session.ispostmarket | Name | session.ispostmarket | Same | |
session.isfirstbar_regular | Name | session.isfirstbar | Same | |
session.islastbar_regular | Name | session.islastbar | Same | |
session.isfirstbar | Name | session.isfirstbar | Close | The first bar counts from the regular open. The source counts from the first bar of the day, extended hours included. |
session.islastbar | Name | session.islastbar | Close | The last bar ends at the regular close. The source counts to the last bar of the day, extended hours included. |
timenow | Name | Not converted | Refused | Remove the value, or replace it with a fixed input. convert-nondeterministic |
chart.bg_color | Name | Not converted | Refused | Write the calculation with ITMScript operators, or remove the line. convert-unknown-call |
dividends.gross | Name | Not converted | Refused | Use a price series declared with series(symbol=...), or enter the value as an input.float. convert-request-feed |
earnings.gross | Name | Not converted | Refused | Use a price series declared with series(symbol=...), or enter the value as an input.float. convert-request-feed |
splits.gross | Name | Not converted | Refused | Use a price series declared with series(symbol=...), or enter the value as an input.float. convert-request-feed |
request.security_lower_tf | Call | Not converted | Refused | Run the study on the finer chart and declare the coarser series with series(timeframe=...). convert-security-lower-tf |
request.financial | Call | Not converted | Refused | Use a price series declared with series(symbol=...), or enter the value as an input.float. convert-request-feed |
request.economic | Call | Not converted | Refused | Use a price series declared with series(symbol=...), or enter the value as an input.float. convert-request-feed |
request.earnings | Call | Not converted | Refused | Use a price series declared with series(symbol=...), or enter the value as an input.float. convert-request-feed |
request.dividends | Call | Not converted | Refused | Use a price series declared with series(symbol=...), or enter the value as an input.float. convert-request-feed |
request.splits | Call | Not converted | Refused | Use a price series declared with series(symbol=...), or enter the value as an input.float. convert-request-feed |
request.quandl | Call | Not converted | Refused | Use a price series declared with series(symbol=...), or enter the value as an input.float. convert-request-feed |
request.seed | Call | Not converted | Refused | Use a price series declared with series(symbol=...), or enter the value as an input.float. convert-request-feed |
request.footprint | Call | Not converted | Refused | Use a price series declared with series(symbol=...), or enter the value as an input.float. convert-request-feed |
request.currency_rate | Call | Not converted | Refused | Use a price series declared with series(symbol=...), or enter the value as an input.float. convert-request-feed |
str.tostring | Call | Not converted | Refused | Compare numbers or conditions instead of text. Keep text for titles and labels. convert-string-op |
str.tonumber | Call | Not converted | Refused | Compare numbers or conditions instead of text. Keep text for titles and labels. convert-string-op |
str.format | Call | Not converted | Refused | Compare numbers or conditions instead of text. Keep text for titles and labels. convert-string-op |
str.contains | Call | Not converted | Refused | Compare numbers or conditions instead of text. Keep text for titles and labels. convert-string-op |
str.replace | Call | Not converted | Refused | Compare numbers or conditions instead of text. Keep text for titles and labels. convert-string-op |
str.split | Call | Not converted | Refused | Compare numbers or conditions instead of text. Keep text for titles and labels. convert-string-op |
str.substr | Call | Not converted | Refused | Compare numbers or conditions instead of text. Keep text for titles and labels. convert-string-op |
str.upper | Call | Not converted | Refused | Compare numbers or conditions instead of text. Keep text for titles and labels. convert-string-op |
str.lower | Call | Not converted | Refused | Compare numbers or conditions instead of text. Keep text for titles and labels. convert-string-op |
str.length | Call | Not converted | Refused | Compare numbers or conditions instead of text. Keep text for titles and labels. convert-string-op |
str.trim | Call | Not converted | Refused | Compare numbers or conditions instead of text. Keep text for titles and labels. convert-string-op |
str.startswith | Call | Not converted | Refused | Compare numbers or conditions instead of text. Keep text for titles and labels. convert-string-op |
str.endswith | Call | Not converted | Refused | Compare numbers or conditions instead of text. Keep text for titles and labels. convert-string-op |
strategy.entry | Call | Not converted | Refused | Convert the indicator logic as a study. Mark entries and exits with plotshape or alertcondition. convert-strategy |
strategy.order | Call | Not converted | Refused | Convert the indicator logic as a study. Mark entries and exits with plotshape or alertcondition. convert-strategy |
strategy.exit | Call | Not converted | Refused | Convert the indicator logic as a study. Mark entries and exits with plotshape or alertcondition. convert-strategy |
strategy.close | Call | Not converted | Refused | Convert the indicator logic as a study. Mark entries and exits with plotshape or alertcondition. convert-strategy |
strategy.close_all | Call | Not converted | Refused | Convert the indicator logic as a study. Mark entries and exits with plotshape or alertcondition. convert-strategy |
strategy.cancel | Call | Not converted | Refused | Convert the indicator logic as a study. Mark entries and exits with plotshape or alertcondition. convert-strategy |
strategy.cancel_all | Call | Not converted | Refused | Convert the indicator logic as a study. Mark entries and exits with plotshape or alertcondition. convert-strategy |
label.new | Call | Not converted | Refused | Plot the level as a series with plot or hline. Use value or events for a table of numbers. convert-drawing |
line.new | Call | Not converted | Refused | Plot the level as a series with plot or hline. Use value or events for a table of numbers. convert-drawing |
box.new | Call | Not converted | Refused | Plot the level as a series with plot or hline. Use value or events for a table of numbers. convert-drawing |
table.new | Call | Not converted | Refused | Plot the level as a series with plot or hline. Use value or events for a table of numbers. convert-drawing |
linefill.new | Call | Not converted | Refused | Plot the level as a series with plot or hline. Use value or events for a table of numbers. convert-drawing |
polyline.new | Call | Not converted | Refused | Plot the level as a series with plot or hline. Use value or events for a table of numbers. convert-drawing |
array.* | Call | Not converted | Refused | Use a rolling window over the series. For example ta.highest(x, N) replaces a scan of an array of the last N values. convert-collection |
array.* | Name | Not converted | Refused | Use a rolling window over the series. For example ta.highest(x, N) replaces a scan of an array of the last N values. convert-collection |
matrix.* | Call | Not converted | Refused | Use a rolling window over the series. For example ta.highest(x, N) replaces a scan of an array of the last N values. convert-collection |
matrix.* | Name | Not converted | Refused | Use a rolling window over the series. For example ta.highest(x, N) replaces a scan of an array of the last N values. convert-collection |
map.* | Call | Not converted | Refused | Use a rolling window over the series. For example ta.highest(x, N) replaces a scan of an array of the last N values. convert-collection |
map.* | Name | Not converted | Refused | Use a rolling window over the series. For example ta.highest(x, N) replaces a scan of an array of the last N values. convert-collection |
str.* | Call | Not converted | Refused | Compare numbers or conditions instead of text. Keep text for titles and labels. convert-string-op |
str.* | Name | Not converted | Refused | Compare numbers or conditions instead of text. Keep text for titles and labels. convert-string-op |
strategy.* | Call | Not converted | Refused | Convert the indicator logic as a study. Mark entries and exits with plotshape or alertcondition. convert-strategy |
strategy.* | Name | Not converted | Refused | Convert the indicator logic as a study. Mark entries and exits with plotshape or alertcondition. convert-strategy |
request.* | Call | Not converted | Refused | Use a price series declared with series(symbol=...), or enter the value as an input.float. convert-request-feed |
request.* | Name | Not converted | Refused | Use a price series declared with series(symbol=...), or enter the value as an input.float. convert-request-feed |
label.* | Call | Not converted | Refused | Plot the level as a series with plot or hline. Use value or events for a table of numbers. convert-drawing |
label.* | Name | Not converted | Refused | Plot the level as a series with plot or hline. Use value or events for a table of numbers. convert-drawing |
line.* | Call | Not converted | Refused | Plot the level as a series with plot or hline. Use value or events for a table of numbers. convert-drawing |
line.* | Name | Not converted | Refused | Plot the level as a series with plot or hline. Use value or events for a table of numbers. convert-drawing |
box.* | Call | Not converted | Refused | Plot the level as a series with plot or hline. Use value or events for a table of numbers. convert-drawing |
box.* | Name | Not converted | Refused | Plot the level as a series with plot or hline. Use value or events for a table of numbers. convert-drawing |
table.* | Call | Not converted | Refused | Plot the level as a series with plot or hline. Use value or events for a table of numbers. convert-drawing |
table.* | Name | Not converted | Refused | Plot the level as a series with plot or hline. Use value or events for a table of numbers. convert-drawing |
linefill.* | Call | Not converted | Refused | Plot the level as a series with plot or hline. Use value or events for a table of numbers. convert-drawing |
linefill.* | Name | Not converted | Refused | Plot the level as a series with plot or hline. Use value or events for a table of numbers. convert-drawing |
polyline.* | Call | Not converted | Refused | Plot the level as a series with plot or hline. Use value or events for a table of numbers. convert-drawing |
polyline.* | Name | Not converted | Refused | Plot the level as a series with plot or hline. Use value or events for a table of numbers. convert-drawing |
barstate.* | Call | Not converted | Refused | Remove the value, or replace it with a fixed input. convert-nondeterministic |
barstate.* | Name | Not converted | Refused | Remove the value, or replace it with a fixed input. convert-nondeterministic |
timeframe.* | Call | Not converted | Not yet | Use a calendar field such as hour or session.ismarket, a reset= word, or one study for each timeframe. convert-calendar |
timeframe.* | Name | Not converted | Not yet | Use a calendar field such as hour or session.ismarket, a reset= word, or one study for each timeframe. convert-calendar |
session.* | Call | Not converted | Not yet | Use a calendar field such as hour or session.ismarket, a reset= word, or one study for each timeframe. convert-calendar |
session.* | Name | Not converted | Not yet | Use a calendar field such as hour or session.ismarket, a reset= word, or one study for each timeframe. convert-calendar |
syminfo.* | Call | Not converted | Refused | Enter the value as an input.float and set it for the instrument. convert-instrument-meta |
syminfo.* | Name | Not converted | Refused | Enter the value as an input.float and set it for the instrument. convert-instrument-meta |
dayofweek.* | Call | Not converted | Not yet | Use a calendar field such as hour or session.ismarket, a reset= word, or one study for each timeframe. convert-calendar |
dayofweek.* | Name | Not converted | Not yet | Use a calendar field such as hour or session.ismarket, a reset= word, or one study for each timeframe. convert-calendar |
dividends.* | Call | Not converted | Refused | Use a price series declared with series(symbol=...), or enter the value as an input.float. convert-request-feed |
dividends.* | Name | Not converted | Refused | Use a price series declared with series(symbol=...), or enter the value as an input.float. convert-request-feed |
earnings.* | Call | Not converted | Refused | Use a price series declared with series(symbol=...), or enter the value as an input.float. convert-request-feed |
earnings.* | Name | Not converted | Refused | Use a price series declared with series(symbol=...), or enter the value as an input.float. convert-request-feed |
splits.* | Call | Not converted | Refused | Use a price series declared with series(symbol=...), or enter the value as an input.float. convert-request-feed |
splits.* | Name | Not converted | Refused | Use a price series declared with series(symbol=...), or enter the value as an input.float. convert-request-feed |
chart.* | Call | Not converted | Refused | Write the calculation with ITMScript operators, or remove the line. convert-unknown-call |
chart.* | Name | Not converted | Refused | Write the calculation with ITMScript operators, or remove the line. convert-unknown-call |
color.new | Call | color.new | Same | |
color.rgb | Call | color.new | Close | A colour built from numbers was written as a hex colour. |
color.from_gradient | Call | Not converted | Not yet | Choose between constant colours with a condition, such as rsi > 50 ? color.green : color.red. convert-series-color |
color.r | Call | Not converted | Refused | Write the calculation with ITMScript operators, or remove the line. convert-unknown-call |
color.g | Call | Not converted | Refused | Write the calculation with ITMScript operators, or remove the line. convert-unknown-call |
color.b | Call | Not converted | Refused | Write the calculation with ITMScript operators, or remove the line. convert-unknown-call |
color.t | Call | Not converted | Refused | Write the calculation with ITMScript operators, or remove the line. convert-unknown-call |
Statements and inputs
Declarations, inputs, outputs, control flow and the forms the converter lowers itself. Match words are as above.
| Pine Script | Becomes | Match | Note |
|---|---|---|---|
int | x >= 0 ? math.floor(x) : math.ceil(x) | Close | int truncates toward zero. It was written as the floor of a positive value and the ceiling of a negative one. |
float | x | Close | float returns its argument unchanged. |
bool | x != 0 | Close | bool was written as a test that the value is not zero. |
//@version | //@itmscript 2 | Same | |
indicator | study | Same | |
strategy | Not converted | Refused | Convert the indicator logic as a study. Mark entries and exits with plotshape or alertcondition. convert-strategy |
library | Not converted | Refused | Paste the library's functions into the script, or write them as functions. convert-library |
import | Not converted | Refused | Paste the library's functions into the script, or write them as functions. convert-library |
export | Not converted | Refused | Paste the library's functions into the script, or write them as functions. convert-library |
var | Not converted | Not yet | Write the recurrence by hand with scan(x, init, f), or use an operator such as ta.ema, ta.cum, latch or hold. convert-state |
varip | Not converted | Refused | Compute the value once per bar. Use ta.* operators and x[1] for history. convert-varip |
:= | Not converted | Not yet | Write the recurrence by hand with scan(x, init, f), or use an operator such as ta.ema, ta.cum, latch or hold. convert-state |
if | Not converted | Not yet | Write the value as a ternary, cond ? a : b, with one expression for each branch. convert-parse |
switch | Not converted | Not yet | Write the value as a ternary, cond ? a : b, with one expression for each branch. convert-parse |
for | Not converted | Refused | Use a rolling operator with a fixed window, such as ta.sma(x, N) or ta.highest(x, N). convert-loop-unbounded |
while | Not converted | Refused | Use a rolling operator with a fixed window, such as ta.sma(x, N) or ta.highest(x, N). convert-loop-unbounded |
method | Not converted | Not yet | Write a function and call it with its argument. convert-parse |
type | Not converted | Refused | User types are not supported. Use separate names for each value. convert-parse |
enum | Not converted | Refused | User types are not supported. Use a choice input or separate names. convert-parse |
request.security | series(symbol=, timeframe=) | Close | A request for another symbol or timeframe was written as a series declaration and reads of its fields. Live bars show the last completed bar. The source shows the forming one. |
log.info | Dropped | Close | A log line has no effect on values. |
log.warning | Dropped | Close | A log line has no effect on values. |
log.error | Dropped | Close | A log line has no effect on values. |
runtime.error | Dropped | Close | A runtime.error call has no effect on values. |
max_bars_back | Dropped | Close | The history depth is set by the windows used. |
input.int | input.int | Same | |
input.float | input.float | Same | |
input.bool | input.bool | Same | |
input.source | input.source | Same | |
input.color | input.color | Same | |
input.string | input.choice | Close | A text input with a list of options became a choice input. It compares with one of its options, and the comparison picks a value. |
input.timeframe | input.timeframe | Close | The frequency of a series is an input here. The chart has to serve the frequency that is chosen. |
input.symbol | input.symbol | Close | The symbol of a series is an input here. It can be changed in the settings. |
input.session | Not converted | Not yet | Use a calendar field such as hour or session.ismarket, a reset= word, or one study for each timeframe. convert-calendar |
input.time | Not converted | Not yet | Use a calendar field such as hour or session.ismarket, a reset= word, or one study for each timeframe. convert-calendar |
input.price | input.float | Close | The price input became a number input. Clicking a price on the chart is not available. |
input.text_area | Not converted | Refused | Compare numbers or conditions instead of text. Keep text for titles and labels. convert-string-op |
input.enum | Not converted | Refused | User types are not supported. Use a choice input. convert-parse |
input | input.float | Close | An untyped input took its kind from its default value. |
plot | plot | Same | |
hline | hline | Same | |
fill | fill | Same | |
bgcolor | bgcolor | Same | |
alertcondition | alertcondition | Same | |
plotshape | plotshape | Same | |
plot.offset | offset | Same | |
plotchar | plotshape | Close | plotchar was written as plotshape with a text label. |
plotarrow | plotshape | Close | plotarrow was written as two shapes, an up arrow and a down arrow. |
alert | Not converted | Not yet | Use alertcondition(condition, "Title", "Message") with the condition that fires the alert. convert-unknown-call |
plotcandle | Not converted | Not yet | Use plotshape markers, or tint the background with bgcolor. convert-host-visual |
plotbar | Not converted | Not yet | Use plotshape markers, or tint the background with bgcolor. convert-host-visual |
barcolor | Not converted | Not yet | Use plotshape markers, or tint the background with bgcolor. convert-host-visual |
Constants
Colours, plot styles, marker styles and locations. The names on the right are listed on the colours and styles page.
| Pine Script | Becomes | Match | Note |
|---|---|---|---|
color.aqua | color.aqua | Same | |
color.black | color.black | Same | |
color.blue | color.blue | Same | |
color.fuchsia | color.fuchsia | Same | |
color.gray | color.gray | Same | |
color.green | color.green | Same | |
color.lime | color.lime | Same | |
color.maroon | color.maroon | Same | |
color.navy | color.navy | Same | |
color.olive | color.olive | Same | |
color.orange | color.orange | Same | |
color.purple | color.purple | Same | |
color.red | color.red | Same | |
color.silver | color.silver | Same | |
color.teal | color.teal | Same | |
color.white | color.white | Same | |
color.yellow | color.yellow | Same | |
plot.style_line | line | Same | |
plot.style_histogram | histogram | Same | |
plot.style_area | area | Same | |
plot.style_columns | columns | Same | |
plot.style_stepline | stepline | Same | |
plot.style_circles | circles | Same | |
plot.style_cross | cross | Same | |
plot.style_linebr | line | Close | The line break at a gap is not drawn. A line was used. |
plot.style_areabr | area | Close | The break at a gap is not drawn. An area was used. |
plot.style_stepline_diamond | stepline | Close | The diamond markers are not drawn. A step line was used. |
shape.triangleup | triangleup | Same | |
shape.triangledown | triangledown | Same | |
shape.arrowup | arrowup | Same | |
shape.arrowdown | arrowdown | Same | |
shape.circle | circle | Same | |
shape.labelup | label | Close | A label marker was used. |
shape.labeldown | label | Close | A label marker was used. |
shape.xcross | circle | Close | This shape is not available. A circle was used. |
shape.cross | circle | Close | This shape is not available. A circle was used. |
shape.diamond | circle | Close | This shape is not available. A circle was used. |
shape.square | circle | Close | This shape is not available. A circle was used. |
shape.flag | circle | Close | This shape is not available. A circle was used. |
location.abovebar | abovebar | Same | |
location.belowbar | belowbar | Same | |
location.absolute | absolute | Same | |
location.top | absolute | Close | The top of the pane is not available. An absolute location was used. |
location.bottom | absolute | Close | The bottom of the pane is not available. An absolute location was used. |
hline.style_solid | solid | Same | |
hline.style_dashed | dashed | Same | |
hline.style_dotted | dotted | Same | |
display.none | none | Same |