volume_flow_indicator
Volume flow indicator
volume_flow_indicator
examples/site_showcase.rs// Volume flow indicator (Katsanos, 2004): the volume of bars whose typical price rose or fell by more than a cutoff, capped at a multiple of the average volume, summed over period bars and divided by the average volume before the bar, smoothed; the cutoff uses a fixed 30-bar volatility of log typical-price ratios. Extra raw is the unsmoothed ratio; nothing is published while the average volume is zero
// Defaults of "volume_flow_indicator" (see the indicator reference)
let params = HashMap::from([
("coef".to_string(), 0.2),
("period".to_string(), 130.0),
("smoothing".to_string(), 3.0),
("vcoef".to_string(), 2.5),
]);
let mut indicator = build_checked("volume_flow_indicator", ¶ms)?;
for bar in &bars {
if let Some(output) = indicator.on_bar(bar) {
// output.value, output.extra[...], indicator.alerts()
}
}