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

Function bars_build_run_bars

crates/pyopenquant/src/bars.rs:68–80  ·  view source on GitHub ↗
(
    timestamps: Vec<String>,
    prices: Vec<f64>,
    volumes: Vec<f64>,
    threshold: usize,
)

Source from the content-addressed store, hash-verified

66 Ok(bars_to_rows(bars))
67}
68
69#[pyfunction(name = "build_run_bars")]
70fn 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

Callers

nothing calls this directly

Calls 3

build_tradesFunction · 0.85
run_barsFunction · 0.85
bars_to_rowsFunction · 0.85

Tested by

no test coverage detected