(
timestamps: Vec<String>,
prices: Vec<f64>,
volumes: Vec<f64>,
volume_per_bar: f64,
)
| 36 | Ok(bars_to_rows(bars)) |
| 37 | } |
| 38 | |
| 39 | #[pyfunction(name = "build_volume_bars")] |
| 40 | fn bars_build_volume_bars( |
| 41 | timestamps: Vec<String>, |
| 42 | prices: Vec<f64>, |
| 43 | volumes: Vec<f64>, |
| 44 | volume_per_bar: f64, |
| 45 | ) -> PyResult<Vec<(String, String, f64, f64, f64, f64, f64, f64, usize)>> { |
| 46 | if !volume_per_bar.is_finite() || volume_per_bar <= 0.0 { |
| 47 | return Err(PyValueError::new_err("volume_per_bar must be > 0")); |
| 48 | } |
| 49 | let trades = build_trades(timestamps, prices, volumes)?; |
| 50 | let bars = standard_bars(&trades, volume_per_bar, StandardBarType::Volume); |
| 51 | Ok(bars_to_rows(bars)) |
| 52 | } |
| 53 |
nothing calls this directly
no test coverage detected