Skip to main content

Module indicator

Module indicator 

Source
Expand description

StatIndicator: technical-analysis indicators for price series, to overlay on (or stack under) candlestick / line charts: geom_line().stat(StatIndicator::new(Indicator::Ema(20))).

Rows are taken in x order. The price is close when mapped, else y; ATR and the stochastic oscillator also need high/low, VWAP uses weight as volume. Output keeps x and puts the indicator in y (Bollinger bands also in ymin/ymax); warm-up rows without a value are dropped. Smoothing follows the TA-Lib conventions: EMA seeded with the SMA of its first n values, RSI and ATR with Wilder’s smoothing.

Structs§

StatIndicator
Indicator stat (see the module docs).

Enums§

Indicator
A technical indicator.
MacdPart
Which MACD series to emit.

Functions§

ema
EMA with α = 2/(n+1), seeded with the SMA of the first n values.
rsi
RSI with Wilder’s smoothing (α = 1/n), seeded with the mean gain/loss of the first n changes.
sma
Simple moving average; None during the warm-up.
wma
Linearly weighted moving average (weights 1..n, newest heaviest).