kestrel-chartkitv0.49.0

← All examples

demarker

DeMarker: the sum of the rises of the high over the sum of the rises of the high and the falls of the low a…

demarker

examples/site_showcase.rs
// DeMarker: the sum of the rises of the high over the sum of the rises of the high and the falls of the low across `period` bars; 0 to 1, and 0.5 on a window without rises or falls. Published from bar period + 1.
// Defaults of "demarker" (see the indicator reference)
let params = HashMap::from([
    ("lower".to_string(), 0.3),
    ("period".to_string(), 14.0),
    ("upper".to_string(), 0.7),
]);
let mut indicator = build_checked("demarker", &params)?;

for bar in &bars {
    if let Some(output) = indicator.on_bar(bar) {
        // output.value, output.extra[...], indicator.alerts()
    }
}
DeMarker: the sum of the rises of the high over the sum of the rises of the high and the falls of the low across `period` bars; 0 to 1, and 0.5 on a window without rises or falls. Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 7 alerts in view, the latest as markers.DeMarker: the sum of the rises of the high over the sum of the rises of the high and the falls of the low across `period` bars; 0 to 1, and 0.5 on a window without rises or falls. Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 7 alerts in view, the latest as markers.
  • Oscillators
  • unit: Ratio