Volatility Indicators
Back to API overview
11 functions.
pta.adr
Average Day Range
pta.adr(high=pl.col("high"), low=pl.col("low"), time_period=14)
TA-Lib name: ADR
| Input |
Default |
high |
pl.col("high") |
low |
pl.col("low") |
Parameters
| Parameter |
TA-Lib name |
Type |
Default |
Range / values |
time_period |
optInTimePeriod |
int |
14 |
1 .. 100000 |
Outputs
Example
df.select(pta.adr(time_period=20).alias("adr"))
pta.atr
Average True Range
pta.atr(high=pl.col("high"), low=pl.col("low"), close=pl.col("close"), time_period=14)
TA-Lib name: ATR
| Input |
Default |
high |
pl.col("high") |
low |
pl.col("low") |
close |
pl.col("close") |
Parameters
| Parameter |
TA-Lib name |
Type |
Default |
Range / values |
time_period |
optInTimePeriod |
int |
14 |
1 .. 100000 |
Outputs
Example
df.select(pta.atr(time_period=20).alias("atr"))
pta.bbw
Bollinger BandWidth
pta.bbw(real=pl.col("close"), time_period=20, nb_dev_up=2, nb_dev_dn=2, ma_type=0)
TA-Lib name: BBW
| Input |
Default |
real |
pl.col("close") |
Parameters
| Parameter |
TA-Lib name |
Type |
Default |
Range / values |
time_period |
optInTimePeriod |
int |
20 |
2 .. 100000 |
nb_dev_up |
optInNbDevUp |
float |
2 |
-3e+37 .. 3e+37 |
nb_dev_dn |
optInNbDevDn |
float |
2 |
-3e+37 .. 3e+37 |
ma_type |
optInMAType |
int or name |
0 |
SMA, EMA, WMA, DEMA, TEMA, TRIMA, KAMA, MAMA, T3, HMA, DISABLED, DEFAULT, ZLEMA, RMA, VIDYA, ALMA |
Outputs
Example
df.select(pta.bbw(time_period=20).alias("bbw"))
pta.cvi
Chaikin's Volatility
pta.cvi(high=pl.col("high"), low=pl.col("low"), time_period=10, roc_period=10)
TA-Lib name: CVI
| Input |
Default |
high |
pl.col("high") |
low |
pl.col("low") |
Parameters
| Parameter |
TA-Lib name |
Type |
Default |
Range / values |
time_period |
optInTimePeriod |
int |
10 |
2 .. 100000 |
roc_period |
optInROCPeriod |
int |
10 |
1 .. 100000 |
Outputs
Example
df.select(pta.cvi(time_period=20).alias("cvi"))
pta.massi
Mass Index
pta.massi(high=pl.col("high"), low=pl.col("low"), fast_period=9, slow_period=25)
TA-Lib name: MASSI
| Input |
Default |
high |
pl.col("high") |
low |
pl.col("low") |
Parameters
| Parameter |
TA-Lib name |
Type |
Default |
Range / values |
fast_period |
optInFastPeriod |
int |
9 |
2 .. 100000 |
slow_period |
optInSlowPeriod |
int |
25 |
2 .. 100000 |
Outputs
Example
df.select(pta.massi().alias("massi"))
pta.natr
Normalized Average True Range
pta.natr(high=pl.col("high"), low=pl.col("low"), close=pl.col("close"), time_period=14)
TA-Lib name: NATR
| Input |
Default |
high |
pl.col("high") |
low |
pl.col("low") |
close |
pl.col("close") |
Parameters
| Parameter |
TA-Lib name |
Type |
Default |
Range / values |
time_period |
optInTimePeriod |
int |
14 |
1 .. 100000 |
Outputs
Example
df.select(pta.natr(time_period=20).alias("natr"))
pta.percentb
Bollinger Bands %B
pta.percentb(real=pl.col("close"), time_period=20, nb_dev_up=2, nb_dev_dn=2, ma_type=0)
TA-Lib name: PERCENTB
| Input |
Default |
real |
pl.col("close") |
Parameters
| Parameter |
TA-Lib name |
Type |
Default |
Range / values |
time_period |
optInTimePeriod |
int |
20 |
2 .. 100000 |
nb_dev_up |
optInNbDevUp |
float |
2 |
-3e+37 .. 3e+37 |
nb_dev_dn |
optInNbDevDn |
float |
2 |
-3e+37 .. 3e+37 |
ma_type |
optInMAType |
int or name |
0 |
SMA, EMA, WMA, DEMA, TEMA, TRIMA, KAMA, MAMA, T3, HMA, DISABLED, DEFAULT, ZLEMA, RMA, VIDYA, ALMA |
Outputs
Example
df.select(pta.percentb(time_period=20).alias("percentb"))
Rogers-Satchell Volatility
pta.rogerssatchell(open=pl.col("open"), high=pl.col("high"), low=pl.col("low"), close=pl.col("close"), time_period=10, annualization=252)
TA-Lib name: ROGERSSATCHELL
| Input |
Default |
open |
pl.col("open") |
high |
pl.col("high") |
low |
pl.col("low") |
close |
pl.col("close") |
Parameters
| Parameter |
TA-Lib name |
Type |
Default |
Range / values |
time_period |
optInTimePeriod |
int |
10 |
1 .. 100000 |
annualization |
optInAnnualization |
float |
252 |
0 .. 3e+37 |
Outputs
Example
df.select(pta.rogerssatchell(time_period=20).alias("rogerssatchell"))
pta.rvi
Relative Volatility Index
pta.rvi(real=pl.col("close"), time_period=14, std_dev_period=10)
TA-Lib name: RVI
| Input |
Default |
real |
pl.col("close") |
Parameters
| Parameter |
TA-Lib name |
Type |
Default |
Range / values |
time_period |
optInTimePeriod |
int |
14 |
1 .. 100000 |
std_dev_period |
optInStdDevPeriod |
int |
10 |
2 .. 100000 |
Outputs
Example
df.select(pta.rvi(time_period=20).alias("rvi"))
pta.rvir
Relative Volatility Index, refined high/low form
pta.rvir(high=pl.col("high"), low=pl.col("low"), time_period=14, std_dev_period=10)
TA-Lib name: RVIR
| Input |
Default |
high |
pl.col("high") |
low |
pl.col("low") |
Parameters
| Parameter |
TA-Lib name |
Type |
Default |
Range / values |
time_period |
optInTimePeriod |
int |
14 |
1 .. 100000 |
std_dev_period |
optInStdDevPeriod |
int |
10 |
2 .. 100000 |
Outputs
Example
df.select(pta.rvir(time_period=20).alias("rvir"))
pta.trange
True Range
pta.trange(high=pl.col("high"), low=pl.col("low"), close=pl.col("close"))
TA-Lib name: TRANGE
| Input |
Default |
high |
pl.col("high") |
low |
pl.col("low") |
close |
pl.col("close") |
Parameters
None.
Outputs
Example
df.select(pta.trange().alias("trange"))