pub struct Indicators {Show 29 fields
pub opens: VecDeque<f64>,
pub highs: VecDeque<f64>,
pub lows: VecDeque<f64>,
pub closes: VecDeque<f64>,
pub volumes: VecDeque<f64>,
pub times: VecDeque<i64>,
pub vwap: Option<f64>,
pub ema: Option<f64>,
pub st: Option<f64>,
pub st_dir_pub: i8,
pub atr: Option<f64>,
pub cluster: usize,
pub dyn_ema_pub: Option<f64>,
pub ts_speed: f64,
pub ts_norm: f64,
pub ts_bullish: bool,
pub bull_avg: f64,
pub bear_avg: f64,
pub dominance: f64,
pub ao: f64,
pub ao_rising: bool,
pub wr_pct: f64,
pub mom_pct: f64,
pub wave_ok_long: bool,
pub wave_ok_short: bool,
pub mom_ok_long: bool,
pub mom_ok_short: bool,
pub hurst: f64,
pub price_accel: f64,
/* private fields */
}Expand description
Full indicator engine (Layers 1–4, 9–11).
Call Indicators::update once per closed candle.
After training_period candles, Indicators::st and related fields become Some.
Fields§
§opens: VecDeque<f64>§highs: VecDeque<f64>§lows: VecDeque<f64>§closes: VecDeque<f64>§volumes: VecDeque<f64>§times: VecDeque<i64>§vwap: Option<f64>Layer 1 — intraday VWAP, resets at UTC midnight.
ema: Option<f64>Layer 2 — EMA of configurable period.
st: Option<f64>Layer 3 — SuperTrend line value.
st_dir_pub: i8Layer 3 — SuperTrend direction: -1 = bullish (price above ST), +1 = bearish.
atr: Option<f64>Layer 3 — RMA ATR used for SuperTrend.
cluster: usizeLayer 3 — KMeans cluster index (0 = high vol, 1 = mid, 2 = low vol).
dyn_ema_pub: Option<f64>Layer 4 — dynamic EMA.
ts_speed: f64Layer 4 — HMA-smoothed wave speed.
ts_norm: f64Layer 4 — wave speed normalised 0–1.
ts_bullish: boolLayer 4 — true when wave speed is positive.
bull_avg: f64Layer 4 — average bull wave magnitude.
bear_avg: f64Layer 4 — average bear wave magnitude.
dominance: f64Layer 4 — bull_avg - |bear_avg|.
ao: f64Layer 9 — Awesome Oscillator value.
ao_rising: boolLayer 9 — true when AO is rising.
wr_pct: f64Layer 9 — wave ratio percentile.
mom_pct: f64Layer 9 — momentum percentile.
wave_ok_long: bool§wave_ok_short: bool§mom_ok_long: bool§mom_ok_short: bool§hurst: f64Layer 10 — Hurst exponent (0.5 = random, >0.52 = trending).
price_accel: f64Layer 11 — normalised price acceleration (−1 to +1).
Implementations§
Source§impl Indicators
impl Indicators
pub fn new(cfg: IndicatorConfig) -> Self
Sourcepub fn update(&mut self, candle: &Candle) -> bool
pub fn update(&mut self, candle: &Candle) -> bool
Feed one closed candle. Returns true once SuperTrend is ready.
Sourcepub fn check_speed_exit(&self, position: i32) -> bool
pub fn check_speed_exit(&self, position: i32) -> bool
Returns true if a speed-exit condition is triggered for the given position.
position: +1 = long, -1 = short.
Returns false when ts_speed_exit_threshold is None.