pub struct Cci { /* private fields */ }Expand description
Commodity Channel Index with a smoothed line, a signal and a context line.
Over the last cci_len typical prices (high + low + close) / 3 the raw CCI is
(price - SMA) / (0.015 * mean_abs_deviation), 0 for a zero deviation. value is the
line: an exponential average over avg_len of the raw CCI, seeded with its first value.
extra["signal"] is the same average over sig_len of the line; the context line uses
ctx_len. Alerts fire on line/signal and zero crosses and on divergences.
First output: with the cci_len-th bar. Indicator::reset clears windows and averages.
Implementations§
Trait Implementations§
Source§impl Indicator for Cci
impl Indicator for Cci
fn name(&self) -> &str
fn warmup_period(&self) -> usize
fn on_bar(&mut self, bar: &Bar) -> Option<IndicatorOutput>
fn reset(&mut self)
fn alerts(&self) -> Vec<IndicatorAlert>
Source§fn on_checked_bar(
&mut self,
bar: &Bar,
) -> Result<Option<IndicatorOutput>, BarValidationError>
fn on_checked_bar( &mut self, bar: &Bar, ) -> Result<Option<IndicatorOutput>, BarValidationError>
Validates a bar before forwarding it to
Indicator::on_bar.Auto Trait Implementations§
impl Freeze for Cci
impl RefUnwindSafe for Cci
impl Send for Cci
impl Sync for Cci
impl Unpin for Cci
impl UnsafeUnpin for Cci
impl UnwindSafe for Cci
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more