Module Algostream_order_management.Book_impact

Order book impact estimation.

Two flavors:

type estimate = {
  1. avg_fill_price : float;
  2. worst_fill_price : float;
  3. slippage_bps : float;
    (*

    vs mid, signed positive when adverse to the order side

    *)
  4. quantity_filled : float;
  5. levels_consumed : int;
  6. unfilled_quantity : float;
}
val estimate_from_book : side:Order.order_side -> quantity:float -> book:Order_book.order_book -> estimate
type permanent_impact = {
  1. impact_bps : float;
  2. participation_rate : float;
}
val permanent_impact : quantity:float -> daily_volume:float -> daily_vol:float -> ?gamma:float -> unit -> permanent_impact

permanent_impact uses the standard literature gamma = 0.5 (Almgren et al. 2005, "Direct Estimation of Equity Market Impact"). Participation rate is capped at 1.0; an order larger than daily_volume is not practically executable in a single day.