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§

source

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.

source

fn trade(&self, order: &mut Order, qty: f32, depth: &MD)

Adjusts the estimation values when market trades occur at the same price.

source

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.

source

fn is_filled(&self, order: &Order, depth: &MD) -> f32

Implementors§

source§

impl<MD> QueueModel<MD> for RiskAdverseQueueModel<MD>
where MD: MarketDepth,

source§

impl<P, MD> QueueModel<MD> for ProbQueueModel<P, MD>
where P: Probability, MD: MarketDepth,