Module Algostream_pairs.Snapshot

Immutable per-pair snapshot.

The pairs Processor allocates a fresh t per per-pair update and publishes it via Atomic.set into a per-pair t Atomic.t. Downstream strategies read via Atomic.get — release-acquire ordering is sufficient because t itself never mutates after publication.

signal is the most recent Mean_reversion.signal returned by the per-pair classifier. cointegrated, adf_*, half_life_bars reflect the most recent bar-cadence retest (or cleared defaults if no retest has fired yet).

type t = {
  1. pair : Pair_id.t;
  2. last_event_ts_ns : int64;
  3. n_ticks : int;
  4. n_bars : int;
  5. last_price_y : float;
  6. last_price_x : float;
  7. beta : float;
  8. beta_stdev : float;
  9. intercept : float;
  10. spread : float;
  11. spread_mean : float;
  12. spread_std : float;
  13. z_score : float;
  14. corr : float;
  15. adf_t_stat : float;
  16. adf_p_value : float;
  17. cointegrated : bool;
  18. half_life_bars : float;
  19. avg_volume : float;
  20. signal : Mean_reversion.signal;
  21. ready : bool;
}
val empty : pair:Pair_id.t -> t
val to_string : t -> string