twap
Anchored Time Weighted Average Price
twap
examples/site_showcase.rs// Anchored Time Weighted Average Price (no volume; build_typed accepts weighting=per_bar|by_duration and anchor=continuous|daily|manual_timestamp)
// Defaults of "twap" (see the indicator reference)
let params = HashMap::from([
("day_start_offset".to_string(), 0.0),
]);
let mut indicator = build_checked("twap", ¶ms)?;
for bar in &bars {
if let Some(output) = indicator.on_bar(bar) {
// output.value, output.extra[...], indicator.alerts()
}
}