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

Function load_close

crates/openquant/tests/labeling.rs:25–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23}
24
25fn load_close() -> Vec<(NaiveDateTime, f64)> {
26 let path = fixture_dir().join("dollar_bar_sample.csv");
27 let mut rdr = ReaderBuilder::new().has_headers(true).from_path(&path).expect("read csv");
28 let mut out = Vec::new();
29 for result in rdr.deserialize::<Row>() {
30 let row = result.expect("row");
31 let ts = NaiveDateTime::parse_from_str(&row.date_time, "%Y-%m-%d %H:%M:%S%.f")
32 .expect("parse date");
33 out.push((ts, row.close));
34 }
35 out
36}
37
38fn events_to_map(
39 events: Vec<(NaiveDateTime, Event)>,

Callers 7

test_daily_volatilityFunction · 0.70
test_vertical_barriersFunction · 0.70
test_pt_sl_levelsFunction · 0.70
test_drop_labelsFunction · 0.70

Calls 1

fixture_dirFunction · 0.70

Tested by

no test coverage detected