(
timestamps_us: Vec<i64>,
symbols: Vec<String>,
open: Vec<f64>,
high: Vec<f64>,
low: Vec<f64>,
close: Vec<f64>,
volume: Vec<f64>,
adj_close: Vec<f64>,
)
| 137 | } |
| 138 | |
| 139 | pub fn build_ohlcv_columns( |
| 140 | timestamps_us: Vec<i64>, |
| 141 | symbols: Vec<String>, |
| 142 | open: Vec<f64>, |
| 143 | high: Vec<f64>, |
| 144 | low: Vec<f64>, |
| 145 | close: Vec<f64>, |
| 146 | volume: Vec<f64>, |
| 147 | adj_close: Vec<f64>, |
| 148 | ) -> PyResult<openquant::data_processing::OhlcvColumns> { |
| 149 | let n = timestamps_us.len(); |
| 150 | let lengths = [ |
| 151 | symbols.len(), |
| 152 | open.len(), |
| 153 | high.len(), |
| 154 | low.len(), |
| 155 | close.len(), |
| 156 | volume.len(), |
| 157 | adj_close.len(), |
| 158 | ]; |
| 159 | if lengths.iter().any(|&len| len != n) { |
| 160 | return Err(PyValueError::new_err(format!( |
| 161 | "ohlcv vector length mismatch: ts={n}, symbol={}, open={}, high={}, low={}, close={}, volume={}, adj_close={}", |
| 162 | symbols.len(), |
| 163 | open.len(), |
| 164 | high.len(), |
| 165 | low.len(), |
| 166 | close.len(), |
| 167 | volume.len(), |
| 168 | adj_close.len(), |
| 169 | ))); |
| 170 | } |
| 171 | Ok(openquant::data_processing::OhlcvColumns { |
| 172 | timestamps_us, |
| 173 | symbols, |
| 174 | open, |
| 175 | high, |
no test coverage detected