Loading...
Searching...
No Matches
ATAS.DataFeedsCore.MboActivityAccumulationSession Class Reference

Resumable, caching wrapper around MboActivityAccumulationCalculator for a regular sample grid over a time-sorted, append-only event stream. More...

Public Member Functions

void Reset ()
 
void Compute (long[] eventMs, decimal[] signedVolumes, int eventCount, long lineageId, MboActivityAccumulationMode mode, int accumulationTimeSec, long firstSampleMs, long stepMs, int sampleCount, out double[] buyValues, out double[] sellValues)
 Compute buy/sell activity for the sample grid { firstSampleMs + i * stepMs : 0 <= i < sampleCount }. Returned arrays are owned by the session, may be longer than sampleCount and are only valid until the next call.
 

Detailed Description

Resumable, caching wrapper around MboActivityAccumulationCalculator for a regular sample grid over a time-sorted, append-only event stream.

The naive calculator is O(total events) per call because every mode carries running state from the very first event. This session removes that cost from steady-state rendering by remembering two suspension points:

  • the state right after the first sample's events were consumed (resume point for repeated draws of the same or a right-shifted grid), and
  • the state after the last sample (resume point for appending samples / consuming freshly appended events at the tail).

Results are bit-identical to MboActivityAccumulationCalculator.Calculate because both run the exact same per-mode kernels in the exact same order.

The caller identifies the event stream by a lineage id: the id must change whenever anything other than a pure tail-append happens to the arrays (replacement, re-sort, rebuild). Within one lineage the event prefix must be immutable and sorted by timestamp. Not thread-safe; call from one thread.

Member Function Documentation

◆ Compute()

void ATAS.DataFeedsCore.MboActivityAccumulationSession.Compute ( long[]  eventMs,
decimal[]  signedVolumes,
int  eventCount,
long  lineageId,
MboActivityAccumulationMode  mode,
int  accumulationTimeSec,
long  firstSampleMs,
long  stepMs,
int  sampleCount,
out double[]  buyValues,
out double[]  sellValues 
)

Compute buy/sell activity for the sample grid { firstSampleMs + i * stepMs : 0 <= i < sampleCount }. Returned arrays are owned by the session, may be longer than sampleCount and are only valid until the next call.

◆ Reset()

void ATAS.DataFeedsCore.MboActivityAccumulationSession.Reset ( )

The documentation for this class was generated from the following file: