Trait hftbacktest::backtest::models::QueueModel
source · pub trait QueueModel<MD>where
MD: MarketDepth,{
// Required methods
fn new_order(&self, order: &mut Order, depth: &MD);
fn trade(&self, order: &mut Order, qty: f32, depth: &MD);
fn depth(&self, order: &mut Order, prev_qty: f32, new_qty: f32, depth: &MD);
fn is_filled(&self, order: &Order, depth: &MD) -> f32;
}
Expand description
Provides an estimation of the order’s queue position.
Required Methods§
sourcefn new_order(&self, order: &mut Order, depth: &MD)
fn new_order(&self, order: &mut Order, depth: &MD)
Initialize the queue position and other necessary values for estimation. This function is called when the exchange model accepts the new order.
sourcefn trade(&self, order: &mut Order, qty: f32, depth: &MD)
fn trade(&self, order: &mut Order, qty: f32, depth: &MD)
Adjusts the estimation values when market trades occur at the same price.
sourcefn depth(&self, order: &mut Order, prev_qty: f32, new_qty: f32, depth: &MD)
fn depth(&self, order: &mut Order, prev_qty: f32, new_qty: f32, depth: &MD)
Adjusts the estimation values when market depth changes at the same price.