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

Function test_ret_attribution

crates/openquant/tests/sample_weights.rs:65–72  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

63);
64
65fn setup_events() -> EventsSetup {
66 let close = load_close();
67 let prices: Vec<f64> = close.iter().map(|(_, p)| *p).collect();
68 let timestamps: Vec<NaiveDateTime> = close.iter().map(|(ts, _)| *ts).collect();
69 let daily_vol = get_daily_vol(&close, 100);
70 let cusum_events =
71 cusum_filter_timestamps(&prices, &timestamps, Threshold::Scalar(0.02)).unwrap();
72 let vertical_barriers = add_vertical_barrier(&cusum_events, &close, 2, 0, 0, 0);
73 let side: Vec<(NaiveDateTime, f64)> = close.iter().map(|(ts, _)| (*ts, 1.0)).collect();
74 let events = get_events(
75 &close,

Callers

nothing calls this directly

Calls 2

setup_eventsFunction · 0.85
get_weights_by_returnFunction · 0.85

Tested by

no test coverage detected