reaction_speed
Reaction Speed: tracks one structure event at a time
reaction_speed
examples/site_showcase.rs// Reaction Speed: tracks one structure event at a time (BOS > liquidity sweep > order-block tap) and scores the reaction: speed to the first reaction candle within react_bars, validation (break of the reaction extreme, ATR-move progress) within valid_bars; value = activity score 50 + 50 tanh((ATR/SMA(ATR) - 1) k); extra while tracking and on the closing bar: reaction, speed, validation, event_dir, event_type (1 BOS, 2 sweep, 3 OB), final_score; no alerts (the score describes a reaction that already happened)
// Defaults of "reaction_speed" (see the indicator reference)
let params = HashMap::from([
("atr_base".to_string(), 50.0),
("atr_len".to_string(), 14.0),
("atr_move".to_string(), 1.6),
("react_bars".to_string(), 8.0),
("swing_len".to_string(), 10.0),
("valid_bars".to_string(), 20.0),
]);
let mut indicator = build_checked("reaction_speed", ¶ms)?;
for bar in &bars {
if let Some(output) = indicator.on_bar(bar) {
// output.value, output.extra[...], indicator.alerts()
}
}