Module Algostream_domain_market.Tick

type tick = {
  1. symbol : Base.string;
  2. timestamp : Timestamp.t;
  3. bid_price : Base.float;
  4. ask_price : Base.float;
  5. bid_size : Base.float;
  6. ask_size : Base.float;
  7. last_price : Base.float Base.option;
  8. last_size : Base.float Base.option;
  9. volume : Base.float;
  10. sequence : Base.int64;
}
type trade_tick = {
  1. symbol : Base.string;
  2. timestamp : Timestamp.t;
  3. price : Base.float;
  4. size : Base.float;
  5. side : [ `Buy | `Sell ];
  6. trade_id : Base.string;
  7. sequence : Base.int64;
}
val create_tick : symbol:Base.string -> timestamp:Timestamp.t -> bid_price:Base.float -> ask_price:Base.float -> bid_size:Base.float -> ask_size:Base.float -> ?last_price:Base.float -> ?last_size:Base.float -> volume:Base.float -> sequence:Base.int64 -> unit -> tick
val create_trade_tick : symbol:Base.string -> timestamp:Timestamp.t -> price:Base.float -> size:Base.float -> side:[ `Buy | `Sell ] -> trade_id:Base.string -> sequence:Base.int64 -> trade_tick
val spread : tick -> Base__Float.t
val mid_price : tick -> Base__Float.t
val is_valid_tick : tick -> Base.bool
val tick_age : trade_tick -> current_time:Timestamp.t -> Base.float
val is_stale : trade_tick -> current_time:Timestamp.t -> max_age:Base.Float.t -> bool