kestrel-chartkitv0.43.0

← All examples

price_location

Where the close stands against its own recent history: the stretch

price_location

examples/site_showcase.rs
// Where the close stands against its own recent history: the stretch (close - EMA) / ATR as value, with atr, ema, range_position (0 low .. 1 high of the range), sma, sma_prior and vol_tercile (0..2) as extras
// Defaults of "price_location" (see the indicator reference)
let params = HashMap::from([
    ("atr_len".to_string(), 14.0),
    ("ema_len".to_string(), 20.0),
    ("range_len".to_string(), 50.0),
    ("slope_bars".to_string(), 20.0),
    ("sma_len".to_string(), 200.0),
    ("vol_warmup".to_string(), 200.0),
    ("vol_window".to_string(), 100.0),
]);
let mut indicator = build_checked("price_location", &params)?;

for bar in &bars {
    if let Some(output) = indicator.on_bar(bar) {
        // output.value, output.extra[...], indicator.alerts()
    }
}

Not yet verified: no independent second implementation yet.

Where the close stands against its own recent history: the stretch (close - EMA) / ATR as value, with atr, ema, range_position (0 low .. Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 0 alerts in view, the latest as markers.Where the close stands against its own recent history: the stretch (close - EMA) / ATR as value, with atr, ema, range_position (0 low .. Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 0 alerts in view, the latest as markers.
  • Market structure and patterns
  • unit: Unitless