pub struct Tsi { /* private fields */ }Expand description
True Strength Index with a signal and a context line.
With m = close - prev_close,
TSI = 100 * Ema(short)(Ema(long)(m)) / Ema(short)(Ema(long)(|m|)), 0 for a zero denominator;
all averages are the shared Ema with its first-sample seed, running from the first change.
extra["signal"] is Ema(sig_len) over the TSI; extra["ctx"] the same construction over the
context lengths.
First output: with the second bar. Indicator::reset clears all averages.
Implementations§
Trait Implementations§
Source§impl Indicator for Tsi
impl Indicator for Tsi
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 Tsi
impl RefUnwindSafe for Tsi
impl Send for Tsi
impl Sync for Tsi
impl Unpin for Tsi
impl UnsafeUnpin for Tsi
impl UnwindSafe for Tsi
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