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

Function bars_to_rows

crates/pyopenquant/src/helpers.rs:119–137  ·  view source on GitHub ↗
(
    bars: Vec<openquant::data_structures::StandardBar>,
)

Source from the content-addressed store, hash-verified

117}
118
119pub fn bars_to_rows(
120 bars: Vec<openquant::data_structures::StandardBar>,
121) -> Vec<(String, String, f64, f64, f64, f64, f64, f64, usize)> {
122 bars.into_iter()
123 .map(|b| {
124 (
125 b.start_timestamp.format("%Y-%m-%d %H:%M:%S").to_string(),
126 b.timestamp.format("%Y-%m-%d %H:%M:%S").to_string(),
127 b.open,
128 b.high,
129 b.low,
130 b.close,
131 b.volume,
132 b.dollar_value,
133 b.tick_count,
134 )
135 })
136 .collect()
137}
138
139pub fn build_ohlcv_columns(
140 timestamps_us: Vec<i64>,

Callers 6

bars_build_time_barsFunction · 0.85
bars_build_tick_barsFunction · 0.85
bars_build_volume_barsFunction · 0.85
bars_build_dollar_barsFunction · 0.85
bars_build_run_barsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected