Skip to main content

submit_bracket

Function submit_bracket 

Source
pub fn submit_bracket(
    sim: &mut FillSimulator,
    side: OrderSide,
    quantity: f64,
    entry: OrderKind,
    stop_loss_trigger: f64,
    take_profit_price: f64,
) -> Option<(u64, u64, u64)>
Expand description

A simple bracket helper: submits an entry order plus stop-loss and take-profit exits that mirror it. Not itself stateful — callers manage the returned IDs (e.g. cancel the untouched exit once the other one fills, which this simulator does not do automatically since it has no concept of linked orders).