runs as written · runs with Bentrix's own convention, said in its note · refused by name, the note says what Bentrix lacks · not yet built.
Functions
ta.alma#
ta.alma(series: float, length: int, offset: num, sigma: num, floor: bool?) → floatThe Arnaud Legoux average from its published definition; the floor of the offset where asked
series | float | required |
length | int | required |
offset | num | required |
sigma | num | required |
floor | bool | optional |
ta.atr#
ta.atr(length: int) → floatThe average true range in the study's convention: TA-Lib's is Wilder's, MetaTrader's a simple average
length | int | required |
ta.barssince#
ta.barssince(condition: bool) → intBars since the condition was last true; na before it ever was
condition | bool | required |
ta.bb#
ta.bb(series: float, length: int, mult: num) → (float,float,float)The basis, upper and lower band; the deviation is the convention's population standard deviation
series | float | required |
length | int | required |
mult | num | required |
ta.bbw#
ta.bbw(series: float, length: int, mult: num) → float(upper - lower) / basis of ta.bb; a ratio, never × 100
series | float | required |
length | int | required |
mult | num | required |
ta.cci#
ta.cci(source: float, length: int) → floatThe commodity channel index of the source
source | float | required |
length | int | required |
ta.change#
ta.change(source: any, length: int?) → TThe difference from length bars ago; for a bool, whether it changed
source | any | required |
length | int | optional |
ta.cmo#
ta.cmo(series: float, length: int) → floatChande's oscillator from the sums of the rises and the falls over the window
series | float | required |
length | int | required |
ta.cog#
ta.cog(source: float, length: int) → floatThe centre of gravity: minus the position-weighted sum over the sum
source | float | required |
length | int | required |
ta.correlation#
ta.correlation(source1: float, source2: float, length: int) → floatPearson's correlation over the window
source1 | float | required |
source2 | float | required |
length | int | required |
ta.cross#
ta.cross(source1: float, source2: float) → boolEither crossing
source1 | float | required |
source2 | float | required |
ta.crossover#
ta.crossover(source1: float, source2: float) → boolThe first is above the second, and was not above on the bar before
source1 | float | required |
source2 | float | required |
ta.crossunder#
ta.crossunder(source1: float, source2: float) → boolThe first is below the second, and was not below on the bar before
source1 | float | required |
source2 | float | required |
ta.cum#
ta.cum(source: float) → floatThe running sum; an na adds nothing
source | float | required |
ta.dema#
ta.dema(source: float, length: int) → floatThe double exponential average in the study's convention
source | float | required |
length | int | required |
ta.dev#
ta.dev(source: float, length: int) → floatThe mean absolute deviation from the window's mean
source | float | required |
length | int | required |
ta.dmi#
ta.dmi(diLength: int, adxSmoothing: int) → (float,float,float)+DI, -DI and ADX from the published definition: Wilder's smoothing of the true range and the directional movements
diLength | int | required |
adxSmoothing | int | required |
ta.ema#
ta.ema(source: float, length: int) → floatThe exponential average in the study's convention: TA-Lib seeds it with the first window's mean, MetaTrader with the first price
source | float | required |
length | int | required |
ta.falling#
ta.falling(source: float, length: int) → boolLess than each of the length values before it
source | float | required |
length | int | required |
ta.highest#
ta.highest(source: any, length: int?) → floatThe greatest of the last length values (high where only a length is given); na values in the window are passed over
source | any | required |
length | int | optional |
ta.highestbars#
ta.highestbars(source: any, length: int?) → intThe offset back to the greatest, as a negative number; the newest wins a tie
source | any | required |
length | int | optional |
ta.hma#
ta.hma(source: float, length: int) → floatThe Hull average, its half and root lengths truncated
source | float | required |
length | int | required |
ta.kc#
ta.kc(series: float, length: int, mult: num, useTrueRange: bool?) → (float,float,float)The basis is an EMA (TA-Lib's), the width Wilder's average of the range
series | float | required |
length | int | required |
mult | num | required |
useTrueRange | bool | optional |
ta.kcw#
ta.kcw(series: float, length: int, mult: num, useTrueRange: bool?) → float(upper - lower) / basis of ta.kc
series | float | required |
length | int | required |
mult | num | required |
useTrueRange | bool | optional |
ta.linreg#
ta.linreg(source: float, length: int, offset: int) → floatThe least-squares line's value at length - 1 - offset
source | float | required |
length | int | required |
offset | int | required |
ta.lowest#
ta.lowest(source: any, length: int?) → floatThe least of the last length values (low where only a length is given); na values are passed over
source | any | required |
length | int | optional |
ta.lowestbars#
ta.lowestbars(source: any, length: int?) → intThe offset back to the least, as a negative number; the newest wins a tie
source | any | required |
length | int | optional |
ta.macd#
ta.macd(source: float, fastlen: int, slowlen: int, siglen: int) → (float,float,float)The line, the signal and the histogram in the study's convention: MetaTrader's signal is a simple average
source | float | required |
fastlen | int | required |
slowlen | int | required |
siglen | int | required |
ta.max#
ta.max(source: float) → floatThe greatest value so far
source | float | required |
ta.median#
ta.median(source: float, length: int) → floatThe middle value of the window; the mean of the two middle values for an even length
source | float | required |
length | int | required |
ta.mfi#
ta.mfi(series: float, length: int) → floatThe money flow index of the series weighted by the bar's volume
series | float | required |
length | int | required |
ta.min#
ta.min(source: float) → floatThe least value so far
source | float | required |
ta.mode#
ta.mode(source: float, length: int) → floatThe most frequent value of the window, the smallest of several; na values are not counted
source | float | required |
length | int | required |
ta.mom#
ta.mom(source: float, length: int) → floatThe difference over length bars; under the MetaTrader convention its ratio form unless the momentum setting says otherwise
source | float | required |
length | int | required |
ta.percentile_linear_interpolation#
ta.percentile_linear_interpolation(source: float, length: int, percentage: num) → floatThe percentile at p/100 × (n - 1) between its two neighbours; na values are not counted
source | float | required |
length | int | required |
percentage | num | required |
ta.percentile_nearest_rank#
ta.percentile_nearest_rank(source: float, length: int, percentage: num) → floatThe value at rank ceil (p/100 × n); na values are not counted
source | float | required |
length | int | required |
percentage | num | required |
ta.percentrank#
ta.percentrank(source: float, length: int) → floatThe percentage of the previous length values not above the current one
source | float | required |
length | int | required |
ta.pivothigh#
ta.pivothigh(a: any, b: any, c: any?) → floatA high reported rightbars bars after it: greater than the leftbars before and the rightbars after; ties are not pivots
a | any | required |
b | any | required |
c | any | optional |
ta.pivotlow#
ta.pivotlow(a: any, b: any, c: any?) → floatA low reported rightbars bars after it: less than the leftbars before and the rightbars after; ties are not pivots
a | any | required |
b | any | required |
c | any | optional |
ta.range#
ta.range(source: float, length: int) → floatThe greatest minus the least of the window
source | float | required |
length | int | required |
ta.rci#
ta.rci(source: float, length: int) → floatSpearman's correlation of the bars' order with their values × 100, ties sharing their mean rank
source | float | required |
length | int | required |
ta.rising#
ta.rising(source: float, length: int) → boolGreater than each of the length values before it
source | float | required |
length | int | required |
ta.rma#
ta.rma(source: float, length: int) → floatWilder's smoothed average, seeded with the first window's mean
source | float | required |
length | int | required |
ta.roc#
ta.roc(source: float, length: int) → floatThe rate of change over the older price; under the MetaTrader convention over the newest price unless the momentum setting says otherwise
source | float | required |
length | int | required |
ta.rsi#
ta.rsi(source: float, length: int) → floatWilder's RSI; one arithmetic in both conventions
source | float | required |
length | int | required |
ta.sar#
ta.sar(start: num, inc: num, max: num) → floatThe parabolic stop and reverse from the published definition, its first direction from the second bar's close
start | num | required |
inc | num | required |
max | num | required |
ta.sma#
ta.sma(source: float, length: int) → floatThe simple average; one arithmetic in both conventions
source | float | required |
length | int | required |
ta.stdev#
ta.stdev(source: float, length: int, biased: bool?) → floatThe population standard deviation in the study's convention (TA-Lib: sum of squares, MetaTrader: two passes); the sample form where biased is false
source | float | required |
length | int | required |
biased | bool | optional |
ta.stoch#
ta.stoch(source: float, high: float, low: float, length: int) → floatThe raw %K; a window with no range answers 100 (MetaTrader's rule)
source | float | required |
high | float | required |
low | float | required |
length | int | required |
ta.supertrend#
ta.supertrend(factor: num, atrPeriod: int) → (float,int)The line and the direction from the published definition: hl2 ± factor × Wilder's ATR, -1 while the line is the lower band
factor | num | required |
atrPeriod | int | required |
ta.swma#
ta.swma(source: float) → floatThe symmetric four-bar average, weights 1, 2, 2, 1 over 6
source | float | required |
ta.tema#
ta.tema(source: float, length: int) → floatThe triple exponential average in the study's convention
source | float | required |
length | int | required |
ta.tr#
ta.tr(handle_na: bool?) → floatThe true range; on the first bar na, or high - low where handle_na is true
handle_na | bool | optional |
ta.tsi#
ta.tsi(source: float, short_length: int, long_length: int) → floatBlau's True Strength Index from its published definition, a ratio in [-1, 1]; its four averages in the study's convention
source | float | required |
short_length | int | required |
long_length | int | required |
ta.valuewhen#
ta.valuewhen(condition: bool, source: any, occurrence: int) → TThe source's value on the occurrence-th most recent bar the condition was true
condition | bool | required |
source | any | required |
occurrence | int | required |
ta.variance#
ta.variance(source: float, length: int, biased: bool?) → floatThe population variance (TA-Lib's sum of squares); the sample form where biased is false
source | float | required |
length | int | required |
biased | bool | optional |
ta.vwap#
ta.vwap(source: float, anchor: bool?, stdev_mult: num?) → floatThe volume-weighted average since the period began: a new day of the bench's clock, or a bar where anchor is true; with stdev_mult, the average and its two bands
source | float | required |
anchor | bool | optional |
stdev_mult | num | optional |
ta.vwma#
ta.vwma(source: float, length: int) → floatThe volume-weighted average over the bar's volume, which is tick volume on these feeds
source | float | required |
length | int | required |
ta.wma#
ta.wma(source: float, length: int) → floatThe linear-weighted average
source | float | required |
length | int | required |
ta.wpr#
ta.wpr(length: int) → floatWilliams %R over the bar's high, low and close; a window with no range keeps the previous value
length | int | required |
Variables
ta.accdist#
Accumulation/distribution
ta.iii#
The intraday intensity index of the bar
ta.nvi#
The negative volume index, from 1, moving only on a bar whose volume fell
ta.obv#
On-balance volume, seeded with the first bar's volume
ta.pvi#
The positive volume index, from 1, moving only on a bar whose volume rose
ta.pvt#
The price-volume trend, the running sum of the close's change over the previous close times the volume
ta.tr#
The true range; na on the first bar
ta.vwap#
The volume-weighted average of hlc3 since a new day of the bench's clock
ta.wad#
Williams' accumulation/distribution from the published definition
ta.wvad#
Williams' variable accumulation/distribution of the bar