Module Algostream_time_series.Bar

OHLCV bar.

Boundary semantics: the interval is half-open — inclusive of open_ts, exclusive of close_ts, where close_ts = open_ts + interval_ns. A tick whose timestamp equals close_ts belongs to the next bar.

partial = true flags a bar emitted by BarBuilder.flush at the end of a stream — its close_ts has not actually been crossed by a later tick. Real-time bar streams never emit partial bars; only flush does.

type t = {
  1. symbol : string;
  2. open_ts : int64;
  3. close_ts : int64;
  4. open_ : float;
  5. high : float;
  6. low : float;
  7. close : float;
  8. volume : float;
  9. n_ticks : int;
  10. partial : bool;
}
val to_csv_row : t -> string