ITMScript · Reference
Operators
124 operators, generated from the catalog the editor and the validator use. Each page gives the signature, the parameters, the outputs and what the operator returns before it has enough bars. The limits page lists what one study may hold.
Annualised volatility
Appearance
Band
Bandwidth
Bar oscillator
Bar range
Cross
Cross series
ta.covMeasure how two series vary together, in the product of their units.ta.regressRegress one series on another to get intercept, slope, fit and the current residual.ta.hedgeratioSize a hedge: how many units of one series offset one unit of another.ta.spreadTake the bar by bar difference of two series, such as two instruments.ta.ratioTake the bar by bar ratio of two series to track relative strength.
Extremes
ta.highestFind the highest value of a series over the last n bars.ta.lowestFind the lowest value of a series over the last n bars.ta.highestbarsCount how many bars ago the highest value of the window was set.ta.lowestbarsCount how many bars ago the lowest value of the window was set.ta.maxTrack the highest level a series has reached, such as the peak of an equity curve.ta.minTrack the lowest level a series has reached, such as the trough of an equity curve.
Momentum
ta.changeMeasure how far a series moved over the last n bars, in its own units.ta.momMeasure momentum as the price change over the last n bars.ta.rocMeasure the percentage change of a series over the last n bars.ta.rsiGauge overbought and oversold conditions on a 0 to 100 scale from recent gains and losses.ta.macdCompare a fast and a slow average to read momentum shifts and crossovers.ta.cciMeasure how far price sits from its average, in units of typical deviation.ta.cmoMeasure momentum from the balance of up and down moves, on a -100 to 100 scale.ta.rciMeasure how steadily a series has risen or fallen over the last n bars, from -100 to 100.
Moving average
ta.smaSmooth a series with the plain average of its last n values.ta.emaFollow price with an average that gives recent bars more weight than old ones.ta.wmaSmooth a series with linearly rising weights so the newest bar counts most.ta.rmaSmooth a series with Wilder's slow average, the smoothing behind the relative strength index.ta.vwmaAverage a series with each bar weighted by its volume.ta.hmaSmooth a series with a Hull moving average, which cuts lag.
Null handling
Performance
Pivot
Quant alias
ta.diffTake the change of a series over the last n bars, in its own units.ta.pctchangeTake the fractional change of a series over the last n bars.ta.lagRead a series as it stood n bars ago.ta.argmaxCount how many bars ago the highest value of the window was set.ta.argminCount how many bars ago the lowest value of the window was set.
Relation
Smoothed momentum
Smoothing
State
ta.cumAdd up a series bar by bar, such as a running volume total, over the run or each period.ta.sumTotal a series over the last n bars.ta.barssinceCount the bars since a condition last held, such as the last up bar.ta.valuewhenRead a series as it stood when a condition last held, or the nth time before.ta.risingTest whether a series has risen on each of the last n bars.ta.fallingTest whether a series has fallen on each of the last n bars.latchKeep a state on between an entry signal and an exit signal, such as a trend that is active.holdKeep the price from the last signal bar, such as the close at the last cross.
Statistic
ta.medianSmooth a series with the middle value of the window, which ignores outliers.ta.devMeasure the average absolute distance of the window from its mean.ta.zscoreExpress how many standard deviations a value sits from its recent mean.ta.percentrankRank the current value against its recent history on a 0 to 100 scale.ta.linregFit a straight line to the last n bars and read its value at the current bar.ta.cogLocate where the weight of the window sits, from the newest bar to the oldest.ta.percentile_nearest_rankRead a percentile of the window as a value that actually occurred.ta.percentile_linear_interpolationRead a percentile of the window, interpolating between the two nearest ranks.ta.rankRank the current value among the last n values, with 1 as the lowest.ta.madMeasure dispersion as the median distance from the median, which resists outliers.ta.skewMeasure whether the window leans toward large gains or large losses.ta.kurtMeasure how heavy the tails of the window are compared with a normal curve.ta.percentileRead a percentile of the window, such as the 90th percentile of recent closes.ta.autocorrMeasure whether a series tends to repeat or reverse its own recent moves.ta.stderrMeasure how far a series scatters around its fitted trend line over the last n bars.
Transform
Trend system
Volatility
ta.stdevMeasure how widely a series has spread around its recent average.ta.varianceMeasure recent dispersion as the squared spread around the window mean.ta.trMeasure the full range of a bar, including any gap from the previous close.ta.atrSize the typical bar to bar movement, for stops and position sizing.ta.ulcerMeasure how deep and how long a series has sat below its recent highs, as a single percentage.
Volume
Volume flow
ta.mfiGauge buying and selling pressure from price and volume on a 0 to 100 scale.ta.obvTrack cumulative volume signed by each bar's direction to confirm a trend.ta.accdistTrack cumulative volume weighted by where each bar closed within its range.ta.pvtTrack cumulative volume scaled by each bar's fractional price change.ta.wadTrack cumulative buying and selling pressure from the close against the prior close, without volume.ta.nviFollow the index that moves only on bars with lower volume than the bar before.ta.pviFollow the index that moves only on bars with higher volume than the bar before.ta.iiiMeasure where each bar closed within its range, divided by its volume.ta.wvadMeasure each bar's body as a share of its range, weighted by volume.
Weighted average
Math
math.absDrop the sign of a value, for example to measure the size of a move.math.maxTake the larger of two series, bar by bar.math.minTake the smaller of two series, bar by bar.math.logTake the natural logarithm of a series, for example to chart price on a log scale.math.log10Take the base 10 logarithm of a series.math.expRaise e to the power of a series, which undoes a natural logarithm.math.avgTake the midpoint of two series, such as the middle of the high and low.math.sqrtTake the square root of a series, for example to turn a variance into a deviation.math.powRaise one series to the power of another.math.roundRound a series to the nearest whole number.math.floorRound a series down to a whole number.math.ceilRound a series up to a whole number.math.signReduce a series to -1, 0 or 1 by its sign, for example to read the direction of a move.math.sinTake the sine of an angle given in radians.math.cosTake the cosine of an angle given in radians.math.tanTake the tangent of an angle given in radians.math.asinTake the arc sine of a value between -1 and 1, as an angle in radians.math.acosTake the arc cosine of a value between -1 and 1, as an angle in radians.math.atanTake the arc tangent of a value, as an angle in radians.math.atan2Take the angle of a slope from its two components, in the correct quadrant.math.todegreesConvert an angle from radians to degrees.math.toradiansConvert an angle from degrees to radians.math.piUse the constant pi in a formula.math.eUse the constant e in a formula.