kestrel-chartkitv0.49.0

← All examples

williams_fractals

Confirmed fractal highs and lows after Williams

williams_fractals

examples/site_showcase.rs
// Confirmed fractal highs and lows after Williams (1995): a bar whose high (low) is strictly above (below) those of span bars on each side, confirmed span bars later; value is the latest up-fractal high, extra down_level the latest down-fractal low, published once both exist
// Defaults of "williams_fractals" (see the indicator reference)
let params = HashMap::from([
    ("span".to_string(), 2.0),
]);
let mut indicator = build_checked("williams_fractals", &params)?;

for bar in &bars {
    if let Some(output) = indicator.on_bar(bar) {
        // output.value, output.extra[...], indicator.alerts()
    }
}
Confirmed fractal highs and lows after Williams (1995): a bar whose high (low) is strictly above (below) those of span bars on each side, confirmed span bars later; value is the latest up-fractal high, extra down_level the latest down-fractal low, published once both exist. Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 31 alerts in view, the latest as markers.Confirmed fractal highs and lows after Williams (1995): a bar whose high (low) is strictly above (below) those of span bars on each side, confirmed span bars later; value is the latest up-fractal high, extra down_level the latest down-fractal low, published once both exist. Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 31 alerts in view, the latest as markers.
  • Market structure and patterns
  • unit: Price