Bentrix Docs
HomePricingDashboard

Assay reference: ta — technical analysis

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#

runs — Bentrix's own convention
ta.alma(series: float, length: int, offset: num, sigma: num, floor: bool?) → float

The Arnaud Legoux average from its published definition; the floor of the offset where asked

seriesfloatrequired
lengthintrequired
offsetnumrequired
sigmanumrequired
floorbooloptional

ta.atr#

runs — Bentrix's own convention
ta.atr(length: int) → float

The average true range in the study's convention: TA-Lib's is Wilder's, MetaTrader's a simple average

lengthintrequired

ta.barssince#

runs
ta.barssince(condition: bool) → int

Bars since the condition was last true; na before it ever was

conditionboolrequired

ta.bb#

runs — Bentrix's own convention
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

seriesfloatrequired
lengthintrequired
multnumrequired

ta.bbw#

runs — Bentrix's own convention
ta.bbw(series: float, length: int, mult: num) → float

(upper - lower) / basis of ta.bb; a ratio, never × 100

seriesfloatrequired
lengthintrequired
multnumrequired

ta.cci#

runs
ta.cci(source: float, length: int) → float

The commodity channel index of the source

sourcefloatrequired
lengthintrequired

ta.change#

runs
ta.change(source: any, length: int?) → T

The difference from length bars ago; for a bool, whether it changed

sourceanyrequired
lengthintoptional

ta.cmo#

runs — Bentrix's own convention
ta.cmo(series: float, length: int) → float

Chande's oscillator from the sums of the rises and the falls over the window

seriesfloatrequired
lengthintrequired

ta.cog#

runs
ta.cog(source: float, length: int) → float

The centre of gravity: minus the position-weighted sum over the sum

sourcefloatrequired
lengthintrequired

ta.correlation#

runs
ta.correlation(source1: float, source2: float, length: int) → float

Pearson's correlation over the window

source1floatrequired
source2floatrequired
lengthintrequired

ta.cross#

runs
ta.cross(source1: float, source2: float) → bool

Either crossing

source1floatrequired
source2floatrequired

ta.crossover#

runs
ta.crossover(source1: float, source2: float) → bool

The first is above the second, and was not above on the bar before

source1floatrequired
source2floatrequired

ta.crossunder#

runs
ta.crossunder(source1: float, source2: float) → bool

The first is below the second, and was not below on the bar before

source1floatrequired
source2floatrequired

ta.cum#

runs — Bentrix's own convention
ta.cum(source: float) → float

The running sum; an na adds nothing

sourcefloatrequired

ta.dema#

runs — Bentrix's own convention
ta.dema(source: float, length: int) → float

The double exponential average in the study's convention

sourcefloatrequired
lengthintrequired

ta.dev#

runs
ta.dev(source: float, length: int) → float

The mean absolute deviation from the window's mean

sourcefloatrequired
lengthintrequired

ta.dmi#

runs
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

diLengthintrequired
adxSmoothingintrequired

ta.ema#

runs — Bentrix's own convention
ta.ema(source: float, length: int) → float

The exponential average in the study's convention: TA-Lib seeds it with the first window's mean, MetaTrader with the first price

sourcefloatrequired
lengthintrequired

ta.falling#

runs — Bentrix's own convention
ta.falling(source: float, length: int) → bool

Less than each of the length values before it

sourcefloatrequired
lengthintrequired

ta.highest#

runs — Bentrix's own convention
ta.highest(source: any, length: int?) → float

The greatest of the last length values (high where only a length is given); na values in the window are passed over

sourceanyrequired
lengthintoptional

ta.highestbars#

runs — Bentrix's own convention
ta.highestbars(source: any, length: int?) → int

The offset back to the greatest, as a negative number; the newest wins a tie

sourceanyrequired
lengthintoptional

ta.hma#

runs
ta.hma(source: float, length: int) → float

The Hull average, its half and root lengths truncated

sourcefloatrequired
lengthintrequired

ta.kc#

runs — Bentrix's own convention
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

seriesfloatrequired
lengthintrequired
multnumrequired
useTrueRangebooloptional

ta.kcw#

runs — Bentrix's own convention
ta.kcw(series: float, length: int, mult: num, useTrueRange: bool?) → float

(upper - lower) / basis of ta.kc

seriesfloatrequired
lengthintrequired
multnumrequired
useTrueRangebooloptional

ta.linreg#

runs
ta.linreg(source: float, length: int, offset: int) → float

The least-squares line's value at length - 1 - offset

sourcefloatrequired
lengthintrequired
offsetintrequired

ta.lowest#

runs — Bentrix's own convention
ta.lowest(source: any, length: int?) → float

The least of the last length values (low where only a length is given); na values are passed over

sourceanyrequired
lengthintoptional

ta.lowestbars#

runs — Bentrix's own convention
ta.lowestbars(source: any, length: int?) → int

The offset back to the least, as a negative number; the newest wins a tie

sourceanyrequired
lengthintoptional

ta.macd#

runs — Bentrix's own convention
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

sourcefloatrequired
fastlenintrequired
slowlenintrequired
siglenintrequired

ta.max#

runs
ta.max(source: float) → float

The greatest value so far

sourcefloatrequired

ta.median#

runs
ta.median(source: float, length: int) → float

The middle value of the window; the mean of the two middle values for an even length

sourcefloatrequired
lengthintrequired

ta.mfi#

runs
ta.mfi(series: float, length: int) → float

The money flow index of the series weighted by the bar's volume

seriesfloatrequired
lengthintrequired

ta.min#

runs
ta.min(source: float) → float

The least value so far

sourcefloatrequired

ta.mode#

runs
ta.mode(source: float, length: int) → float

The most frequent value of the window, the smallest of several; na values are not counted

sourcefloatrequired
lengthintrequired

ta.mom#

runs — Bentrix's own convention
ta.mom(source: float, length: int) → float

The difference over length bars; under the MetaTrader convention its ratio form unless the momentum setting says otherwise

sourcefloatrequired
lengthintrequired

ta.percentile_linear_interpolation#

runs — Bentrix's own convention
ta.percentile_linear_interpolation(source: float, length: int, percentage: num) → float

The percentile at p/100 × (n - 1) between its two neighbours; na values are not counted

sourcefloatrequired
lengthintrequired
percentagenumrequired

ta.percentile_nearest_rank#

runs
ta.percentile_nearest_rank(source: float, length: int, percentage: num) → float

The value at rank ceil (p/100 × n); na values are not counted

sourcefloatrequired
lengthintrequired
percentagenumrequired

ta.percentrank#

runs — Bentrix's own convention
ta.percentrank(source: float, length: int) → float

The percentage of the previous length values not above the current one

sourcefloatrequired
lengthintrequired

ta.pivothigh#

runs — Bentrix's own convention
ta.pivothigh(a: any, b: any, c: any?) → float

A high reported rightbars bars after it: greater than the leftbars before and the rightbars after; ties are not pivots

aanyrequired
banyrequired
canyoptional

ta.pivotlow#

runs — Bentrix's own convention
ta.pivotlow(a: any, b: any, c: any?) → float

A low reported rightbars bars after it: less than the leftbars before and the rightbars after; ties are not pivots

aanyrequired
banyrequired
canyoptional

ta.range#

runs
ta.range(source: float, length: int) → float

The greatest minus the least of the window

sourcefloatrequired
lengthintrequired

ta.rci#

runs — Bentrix's own convention
ta.rci(source: float, length: int) → float

Spearman's correlation of the bars' order with their values × 100, ties sharing their mean rank

sourcefloatrequired
lengthintrequired

ta.rising#

runs — Bentrix's own convention
ta.rising(source: float, length: int) → bool

Greater than each of the length values before it

sourcefloatrequired
lengthintrequired

ta.rma#

runs
ta.rma(source: float, length: int) → float

Wilder's smoothed average, seeded with the first window's mean

sourcefloatrequired
lengthintrequired

ta.roc#

runs — Bentrix's own convention
ta.roc(source: float, length: int) → float

The rate of change over the older price; under the MetaTrader convention over the newest price unless the momentum setting says otherwise

sourcefloatrequired
lengthintrequired

ta.rsi#

runs
ta.rsi(source: float, length: int) → float

Wilder's RSI; one arithmetic in both conventions

sourcefloatrequired
lengthintrequired

ta.sar#

runs
ta.sar(start: num, inc: num, max: num) → float

The parabolic stop and reverse from the published definition, its first direction from the second bar's close

startnumrequired
incnumrequired
maxnumrequired

ta.sma#

runs
ta.sma(source: float, length: int) → float

The simple average; one arithmetic in both conventions

sourcefloatrequired
lengthintrequired

ta.stdev#

runs — Bentrix's own convention
ta.stdev(source: float, length: int, biased: bool?) → float

The population standard deviation in the study's convention (TA-Lib: sum of squares, MetaTrader: two passes); the sample form where biased is false

sourcefloatrequired
lengthintrequired
biasedbooloptional

ta.stoch#

runs — Bentrix's own convention
ta.stoch(source: float, high: float, low: float, length: int) → float

The raw %K; a window with no range answers 100 (MetaTrader's rule)

sourcefloatrequired
highfloatrequired
lowfloatrequired
lengthintrequired

ta.supertrend#

runs
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

factornumrequired
atrPeriodintrequired

ta.swma#

runs
ta.swma(source: float) → float

The symmetric four-bar average, weights 1, 2, 2, 1 over 6

sourcefloatrequired

ta.tema#

runs — Bentrix's own convention
ta.tema(source: float, length: int) → float

The triple exponential average in the study's convention

sourcefloatrequired
lengthintrequired

ta.tr#

runs — Bentrix's own convention
ta.tr(handle_na: bool?) → float

The true range; on the first bar na, or high - low where handle_na is true

handle_nabooloptional

ta.tsi#

runs — Bentrix's own convention
ta.tsi(source: float, short_length: int, long_length: int) → float

Blau's True Strength Index from its published definition, a ratio in [-1, 1]; its four averages in the study's convention

sourcefloatrequired
short_lengthintrequired
long_lengthintrequired

ta.valuewhen#

runs
ta.valuewhen(condition: bool, source: any, occurrence: int) → T

The source's value on the occurrence-th most recent bar the condition was true

conditionboolrequired
sourceanyrequired
occurrenceintrequired

ta.variance#

runs — Bentrix's own convention
ta.variance(source: float, length: int, biased: bool?) → float

The population variance (TA-Lib's sum of squares); the sample form where biased is false

sourcefloatrequired
lengthintrequired
biasedbooloptional

ta.vwap#

runs — Bentrix's own convention
ta.vwap(source: float, anchor: bool?, stdev_mult: num?) → float

The 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

sourcefloatrequired
anchorbooloptional
stdev_multnumoptional

ta.vwma#

runs — Bentrix's own convention
ta.vwma(source: float, length: int) → float

The volume-weighted average over the bar's volume, which is tick volume on these feeds

sourcefloatrequired
lengthintrequired

ta.wma#

runs
ta.wma(source: float, length: int) → float

The linear-weighted average

sourcefloatrequired
lengthintrequired

ta.wpr#

runs — Bentrix's own convention
ta.wpr(length: int) → float

Williams %R over the bar's high, low and close; a window with no range keeps the previous value

lengthintrequired

Variables

ta.accdist#

runs

Accumulation/distribution

ta.iii#

runs

The intraday intensity index of the bar

ta.nvi#

runs

The negative volume index, from 1, moving only on a bar whose volume fell

ta.obv#

runs — Bentrix's own convention

On-balance volume, seeded with the first bar's volume

ta.pvi#

runs

The positive volume index, from 1, moving only on a bar whose volume rose

ta.pvt#

runs

The price-volume trend, the running sum of the close's change over the previous close times the volume

ta.tr#

runs — Bentrix's own convention

The true range; na on the first bar

ta.vwap#

runs — Bentrix's own convention

The volume-weighted average of hlc3 since a new day of the bench's clock

ta.wad#

runs

Williams' accumulation/distribution from the published definition

ta.wvad#

runs

Williams' variable accumulation/distribution of the bar

Bentrix 0.1.382Every number, name and default on these pages is read from the application itself.What is comingWhat changed