Algostream_backtest.Market_viewPer-symbol market state maintained by the engine.
Backs the accessor closures in Strategy.Context.t. The engine owns this; strategies only ever see the closures, so they cannot mutate it.
Also tracks the two conditioning inputs the slippage model wants — realized volatility and average daily volume — and applies permanent impact to the reference mark, so that a large order genuinely moves the market for subsequent fills within the same run.
module Order_book = Algostream_domain_market.Order_bookmodule Regime = Algostream_analytics.Regimeval create : ?vol_window:int -> ?adv_window_ns:int64 -> unit -> tval observe : t -> Data_source.record -> unitFold a market record into the view.
val last_price : t -> string -> float optionval quote : t -> string -> (float * float) optionval book : t -> string -> Order_book.order_book optionval mid : t -> string -> float optionval sigma : t -> string -> float optionRealized volatility of log returns over the trailing window, per observation. None until the window fills.
val adv : t -> string -> float optionVolume observed over the trailing adv_window_ns, scaled to a daily rate. None when too little history has accumulated to extrapolate honestly.
Current regime label, from a per-symbol Analytics.Regime detector driven on observed ticks. None before the detector has warmed up.
val slippage_ctx : t -> string -> Slippage.market_ctx optionAssemble the context the slippage model consumes.
val apply_permanent_impact : t -> string -> bps:float -> unitApply a permanent-impact shift to the reference mark, so a large fill moves the price the rest of the run trades against. bps is signed by the order's side.
val vwap : t -> string -> floatRunning volume-weighted average price since the run began — the benchmark Execution_quality.analyze compares fills against.
val symbols : t -> string list