Price Transform
6 functions.
pta.avgdev
Average Deviation
pta.avgdev(real=pl.col("close"), time_period=14)
TA-Lib name: AVGDEV
Inputs
| Input | Default |
|---|---|
real |
pl.col("close") |
Parameters
| Parameter | TA-Lib name | Type | Default | Range / values |
|---|---|---|---|---|
time_period |
optInTimePeriod |
int | 14 | 2 .. 100000 |
Outputs
| Field | dtype |
|---|---|
real |
Float64 |
Example
df.select(pta.avgdev(time_period=20).alias("avgdev"))
pta.avgprice
Average Price
pta.avgprice(open=pl.col("open"), high=pl.col("high"), low=pl.col("low"), close=pl.col("close"))
TA-Lib name: AVGPRICE
Inputs
| Input | Default |
|---|---|
open |
pl.col("open") |
high |
pl.col("high") |
low |
pl.col("low") |
close |
pl.col("close") |
Parameters
None.
Outputs
| Field | dtype |
|---|---|
real |
Float64 |
Example
df.select(pta.avgprice().alias("avgprice"))
pta.ha
Heikin-Ashi Candles
pta.ha(open=pl.col("open"), high=pl.col("high"), low=pl.col("low"), close=pl.col("close"))
TA-Lib name: HA
Inputs
| Input | Default |
|---|---|
open |
pl.col("open") |
high |
pl.col("high") |
low |
pl.col("low") |
close |
pl.col("close") |
Parameters
None.
Outputs
| Field | dtype |
|---|---|
ha_open |
Float64 |
ha_high |
Float64 |
ha_low |
Float64 |
ha_close |
Float64 |
Returned as a Struct.
Example
df.select(pta.ha().alias("out")).unnest("out")
pta.medprice
Median Price
pta.medprice(high=pl.col("high"), low=pl.col("low"))
TA-Lib name: MEDPRICE
Inputs
| Input | Default |
|---|---|
high |
pl.col("high") |
low |
pl.col("low") |
Parameters
None.
Outputs
| Field | dtype |
|---|---|
real |
Float64 |
Example
df.select(pta.medprice().alias("medprice"))
pta.typprice
Typical Price
pta.typprice(high=pl.col("high"), low=pl.col("low"), close=pl.col("close"))
TA-Lib name: TYPPRICE
Inputs
| Input | Default |
|---|---|
high |
pl.col("high") |
low |
pl.col("low") |
close |
pl.col("close") |
Parameters
None.
Outputs
| Field | dtype |
|---|---|
real |
Float64 |
Example
df.select(pta.typprice().alias("typprice"))
pta.wclprice
Weighted Close Price
pta.wclprice(high=pl.col("high"), low=pl.col("low"), close=pl.col("close"))
TA-Lib name: WCLPRICE
Inputs
| Input | Default |
|---|---|
high |
pl.col("high") |
low |
pl.col("low") |
close |
pl.col("close") |
Parameters
None.
Outputs
| Field | dtype |
|---|---|
real |
Float64 |
Example
df.select(pta.wclprice().alias("wclprice"))