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

Function get_events

crates/openquant/src/labeling.rs:211–229  ·  view source on GitHub ↗

Backward-compatible triple-barrier API.

(
    close: &[(NaiveDateTime, f64)],
    t_events: &[NaiveDateTime],
    pt_sl: (f64, f64),
    target: &[(NaiveDateTime, f64)],
    min_ret: f64,
    num_threads: usize, // unused, kept for parity
 

Source from the content-addressed store, hash-verified

209
210/// Backward-compatible triple-barrier API.
211pub fn get_events(
212 close: &[(NaiveDateTime, f64)],
213 t_events: &[NaiveDateTime],
214 pt_sl: (f64, f64),
215 target: &[(NaiveDateTime, f64)],
216 min_ret: f64,
217 num_threads: usize, // unused, kept for parity
218 vertical_barrier_times: Option<&[(NaiveDateTime, NaiveDateTime)]>,
219 side_prediction: Option<&[(NaiveDateTime, f64)]>,
220) -> Vec<(NaiveDateTime, Event)> {
221 let _ = num_threads;
222 triple_barrier_events(
223 close,
224 t_events,
225 target,
226 TripleBarrierConfig { pt: pt_sl.0, sl: pt_sl.1, min_ret, vertical_barrier_times },
227 side_prediction,
228 )
229}
230
231/// Backward-compatible label API.
232pub fn get_bins(

Callers 6

test_pt_sl_levelsFunction · 0.85
test_drop_labelsFunction · 0.85
setup_eventsFunction · 0.85
labeling_get_eventsFunction · 0.85

Calls 1

triple_barrier_eventsFunction · 0.85

Tested by 5

test_pt_sl_levelsFunction · 0.68
test_drop_labelsFunction · 0.68
setup_eventsFunction · 0.68