(
timestamps: Vec<String>,
prices: Vec<f64>,
volumes: Vec<f64>,
threshold: usize,
)
| 66 | Ok(bars_to_rows(bars)) |
| 67 | } |
| 68 | |
| 69 | #[pyfunction(name = "build_run_bars")] |
| 70 | fn bars_build_run_bars( |
| 71 | timestamps: Vec<String>, |
| 72 | prices: Vec<f64>, |
| 73 | volumes: Vec<f64>, |
| 74 | threshold: usize, |
| 75 | ) -> PyResult<Vec<(String, String, f64, f64, f64, f64, f64, f64, usize)>> { |
| 76 | if threshold == 0 { |
| 77 | return Err(PyValueError::new_err("threshold must be > 0")); |
| 78 | } |
| 79 | let trades = build_trades(timestamps, prices, volumes)?; |
| 80 | let bars = run_bars(&trades, threshold); |
| 81 | Ok(bars_to_rows(bars)) |
| 82 | } |
| 83 |
nothing calls this directly
no test coverage detected