Ticks
Reference
Ticks
The raw trade/quote update a connection emits and every bar builder, order-flow
aggregator and tape consumes. Namespace SabrTrader.Pipeline.Ticks.
Tick
A readonly record struct — passed by value on the hot path; the pipeline never
boxes it or stores a reference. Consumers that need persistent state copy out the fields they care about.
Tick.cspublic readonly record struct Tick(
long SequenceNumber,
DateTime ExchangeTimestampUtc,
string InstrumentId,
double Price,
long Size,
TickFlags Flags,
long IngressStamp = 0,
long StageStamp = 0);
| Member | Type | Meaning |
|---|---|---|
SequenceNumber |
long |
Global ordering key the framework's sequencer assigns at ingest. The canonical ordering for the whole pipeline — replay, backtest and live all use this same field. |
ExchangeTimestampUtc |
DateTime |
Venue-reported timestamp of the trade/quote — true UTC, always. Never rewritten to a display zone. Overlay on the chart with ChartDisplayTime.FromUtc. |
InstrumentId |
string |
The instrument this update belongs to. |
Price |
double |
Trade price, or the quoted bid/ask price. |
Size |
long |
Traded / quoted size. |
Flags |
TickFlags |
Classification bitmask — see below. |
IngressStamp |
long |
Diagnostics only. Stopwatch stamp taken when the process first saw the tick, or 0 when untraced (the common case). Never persisted — a cached tick comes back untraced. Ignore it in ordinary consumers. |
StageStamp |
long |
Diagnostics only, meaningful only when IngressStamp is non-zero. Rolling stamp of the last pipeline hop the tick cleared, used to build the per-hop latency waterfall. |
TickFlags
A [Flags] enum : byte. Multiple bits can be set at once (a print at the bid is both
Trade + AtBid). Bar builders consume only ticks carrying Trade;
order-flow reads the aggressor bits.
TickFlags.cs[Flags]
public enum TickFlags : byte
{
None = 0,
Bid = 1 << 0,
Ask = 1 << 1,
Trade = 1 << 2,
AtAsk = 1 << 3,
AtBid = 1 << 4,
Synthetic = 1 << 7,
}
| Value | Meaning |
|---|---|
None |
No classification. |
Bid |
Quote update reflecting the best bid. |
Ask |
Quote update reflecting the best ask. |
Trade |
An actual trade / print. The only flag bar builders act on for OHLCV. |
AtAsk |
Trade aggressor was a buyer (lifted the ask). |
AtBid |
Trade aggressor was a seller (hit the bid). |
Synthetic |
Pipeline-injected synthetic tick (replay reconstruction, bar-builder edge cases). Indicators usually don't care. |