MCPcopy Create free account
hub / github.com/Open-Quant/openquant / vwap

Function vwap

crates/openquant/src/microstructural_features.rs:348–354  ·  view source on GitHub ↗

Misc helpers

(dollar_volume: &[f64], volume: &[f64])

Source from the content-addressed store, hash-verified

346
347// Misc helpers
348pub fn vwap(dollar_volume: &[f64], volume: &[f64]) -> f64 {
349 let sum_v: f64 = volume.iter().sum();
350 if sum_v == 0.0 {
351 return NAN;
352 }
353 dollar_volume.iter().sum::<f64>() / sum_v
354}
355
356pub fn get_avg_tick_size(tick_sizes: &[f64]) -> f64 {
357 if tick_sizes.is_empty() {

Callers 2

bar_featuresMethod · 0.85
ms_vwapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected