(
timestamps: Vec<String>,
prices: Vec<f64>,
volumes: Vec<f64>,
ticks_per_bar: usize,
)
| 21 | Ok(bars_to_rows(bars)) |
| 22 | } |
| 23 | |
| 24 | #[pyfunction(name = "build_tick_bars")] |
| 25 | fn bars_build_tick_bars( |
| 26 | timestamps: Vec<String>, |
| 27 | prices: Vec<f64>, |
| 28 | volumes: Vec<f64>, |
| 29 | ticks_per_bar: usize, |
| 30 | ) -> PyResult<Vec<(String, String, f64, f64, f64, f64, f64, f64, usize)>> { |
| 31 | if ticks_per_bar == 0 { |
| 32 | return Err(PyValueError::new_err("ticks_per_bar must be > 0")); |
| 33 | } |
| 34 | let trades = build_trades(timestamps, prices, volumes)?; |
| 35 | let bars = standard_bars(&trades, ticks_per_bar as f64, StandardBarType::Tick); |
| 36 | Ok(bars_to_rows(bars)) |
| 37 | } |
| 38 |
nothing calls this directly
no test coverage detected