pub struct KeltnerChannelEngine { /* private fields */ }Expand description
Keltner Channel: an EMA basis with bands at a multiple of the average true range.
basis is an exponential average of the close, alpha = 2/(ema_period + 1), seeded with the
first close and running from the first bar. ATR is the plain mean of the last
atr_period true ranges (the first high - low), not a Wilder average;
upper/lower = basis ± multiplier * ATR.
value: the basis; extra["upper"], extra["lower"], extra["atr"]. The registry accepts
ma_period as a legacy alias for ema_period. First output: with the atr_period-th bar.
Indicator::reset clears the average and the window.
Implementations§
Trait Implementations§
Source§impl Clone for KeltnerChannelEngine
impl Clone for KeltnerChannelEngine
Source§fn clone(&self) -> KeltnerChannelEngine
fn clone(&self) -> KeltnerChannelEngine
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KeltnerChannelEngine
impl Debug for KeltnerChannelEngine
Source§impl Indicator for KeltnerChannelEngine
impl Indicator for KeltnerChannelEngine
fn name(&self) -> &str
fn warmup_period(&self) -> usize
fn reset(&mut self)
fn on_bar(&mut self, bar: &Bar) -> Option<IndicatorOutput>
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 KeltnerChannelEngine
impl RefUnwindSafe for KeltnerChannelEngine
impl Send for KeltnerChannelEngine
impl Sync for KeltnerChannelEngine
impl Unpin for KeltnerChannelEngine
impl UnsafeUnpin for KeltnerChannelEngine
impl UnwindSafe for KeltnerChannelEngine
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