pub struct TemaEngine { /* private fields */ }Expand description
Triple Exponential Moving Average (TEMA) over the closing price.
TEMA = 3 * e1 - 3 * e2 + e3 over three chained exponential averages of period — e1 over
the close, e2 over e1, e3 over e2 — each the shared Ema with its first-sample
seed. All three run from the first close; only the output is withheld until the period-th
bar.
That chaining differs from super::moving_averages::DemaEngine, whose second stage starts
with the first published value of the first. The two produce different early values and
converge as the seeds decay.
First output: with the period-th bar. Indicator::reset clears all three averages.
Implementations§
Trait Implementations§
Source§impl Clone for TemaEngine
impl Clone for TemaEngine
Source§fn clone(&self) -> TemaEngine
fn clone(&self) -> TemaEngine
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 TemaEngine
impl Debug for TemaEngine
Source§impl Indicator for TemaEngine
impl Indicator for TemaEngine
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 TemaEngine
impl RefUnwindSafe for TemaEngine
impl Send for TemaEngine
impl Sync for TemaEngine
impl Unpin for TemaEngine
impl UnsafeUnpin for TemaEngine
impl UnwindSafe for TemaEngine
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