vwap
Rolling Volume Weighted Average Price with sigma bands and slope
vwap
examples/site_showcase.rs// Rolling Volume Weighted Average Price with sigma bands and slope
// Defaults of "vwap" (see the indicator reference)
let params = HashMap::from([
("slope_lookback".to_string(), 20.0),
("window".to_string(), 390.0),
]);
let mut indicator = build_checked("vwap", ¶ms)?;
for bar in &bars {
if let Some(output) = indicator.on_bar(bar) {
// output.value, output.extra[...], indicator.alerts()
}
}