kestrel-chartkitv0.33.0

← All examples

tsi

True Strength Index

tsi

examples/site_showcase.rs
// True Strength Index
// Defaults of "tsi" (see the indicator reference)
let params = HashMap::from([
    ("long_len".to_string(), 25.0),
    ("short_len".to_string(), 13.0),
    ("sig_len".to_string(), 7.0),
]);
let mut indicator = build_checked("tsi", &params)?;

for bar in &bars {
    if let Some(output) = indicator.on_bar(bar) {
        // output.value, output.extra[...], indicator.alerts()
    }
}
True Strength Index. Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 16 alerts in view, the latest as markers.True Strength Index. Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 16 alerts in view, the latest as markers.
  • Oscillators
  • unit: Ratio