OpenD small test 04
每筆數據時間標籤方案 PASS

無OpenD runtime;用FTNN live evidence鎖定每種data嘅market time、server time、receive time同bar key。

FlowPrimary data timeSecondary times用法/限制
Tick bit35exch_ms:交易所撮合毫秒f7 server ms;wall_ms local receive;mono_ms interval clock一frame可batch多筆且常newest-first;落盤按(exch_ms,tick_key)排序。
OrderBook bit3exch_ms:book snapshot exchange-data timewire field3 server ms(現logger未輸出);wall/mono receive同一timestamp可多次/重複;key加bid/ask state hash。
Kline pushts:server bar key(epoch seconds)inner update_ms可擴展;wall/mono receive同bar_ts係forming updates;下一個bar_ts到先final上一支。
0x1811 historyts:bar keyresponse wall/mono+request RTT唔代表逐筆事件時間;metadata-only placeholder分開。
BasicQot bit0exchange_msserver_recv_ms、server_ms、wall/mono可計exchange→server→local delay;not_cal_delay=1時唔做SLA。
StockState bit1payload無market timestamp只有wall/mono receive只能標「收到時間」,唔冒充狀態生效時間。
CSV保留上述原始欄可另加exported_at,但只係寫檔時間檔名/mtime唔係market time。

統一CSV欄命名

event_time_ms      = exch_ms / match_ms(如有)
server_time_ms     = server send ms(如有)
receive_wall_ms    = probe wall_ms
receive_mono_ms    = probe mono_ms(只作gap/latency,唔轉日期)
bar_ts             = Kline server bar key seconds
exported_at_ms     = CSV writer time(optional,永不代替event_time)

驗證規則

  1. 保存raw integer,另外先做timezone格式化;
  2. tick batch先按match/exch time+sequence重排;
  3. 任何負latency先報clock skew,唔截0;
  4. BasicQot not_cal_delay=1就標SLA invalid;
  5. Kline final用next bar key,唔靠收包後等固定秒數;
  6. monotonic clock只算間隔,process restart後唔跨段比較;
  7. CSV resume checkpoint唔改source timestamp。

實證

BasicQot

{
  "ev": "push_basic_price_bit0",
  "exchange_ms": 1795926195040,
  "mkt": 37,
  "mono_ms": 3514575091,
  "nominal": 149.03,
  "not_cal_delay": 1,
  "prev_close": 149.13,
  "sec_id": 88537463839746,
  "server_ms": 1795926198589,
  "server_recv_ms": 1795926195040,
  "wall_ms": 1795926201463
}

Tick

{
  "ev": "push_tick_bit35",
  "exch_ms": 1795892731024,
  "f16": 0.0,
  "f7": 1795892731291.0,
  "f8": 149130000000.0,
  "mkt": 37,
  "mono_ms": 3481107343,
  "n_str": 4,
  "price": 148.26,
  "sec_id": 88537463839746,
  "tick_key": 7713300546769125376,
  "tick_type": 1,
  "vol_u64": 237,
  "wall_ms": 1795892733715
}

OrderBook

{
  "ask1_c": 0,
  "ask1_p": 148.26,
  "ask1_v": 8.89,
  "ask_sum": 8.89,
  "bid1_c": 0,
  "bid1_p": 148.25,
  "bid1_v": 14.996,
  "bid_sum": 14.996,
  "ev": "push_orderbook_bit3",
  "exch_ms": 1795892536569,
  "imb": 0.255631,
  "mkt": 37,
  "mono_ms": 3480914404,
  "nasks": 1,
  "nbids": 1,
  "sec_id": 88537463839746,
  "wall_ms": 1795892540775
}

Kline push

{
  "bit": 10001,
  "c": 147.74,
  "ev": "push_kline_0x1844",
  "h": 147.74,
  "hp_turn": "35.01675",
  "hp_vol": "0.237",
  "l": 147.74,
  "mkt": 37,
  "mono_ms": 3476878816,
  "o": 147.74,
  "sec_id": 88537463839746,
  "seq": 0,
  "ts": 1795888560,
  "turn": 35017,
  "vol": 237,
  "wall_ms": 1795888505188
}

History bar

{
  "bit": 6161,
  "c": 147.73,
  "ev": "rsp_kline_0x1811",
  "h": 147.75,
  "hp_turn": "758.50895",
  "hp_vol": "5.134",
  "l": 147.73,
  "mkt": 37,
  "mono_ms": 3477316835,
  "o": 147.75,
  "sec_id": 88537463839746,
  "seq": 5,
  "ts": 1795888620,
  "turn": 758511,
  "vol": 5134,
  "wall_ms": 1795888943207
}

Pins

BasicQot 11,085 B · 35c067904d961584f2b3234748d5263d3c4ca4111cecb84b394eaafe65cd973c
Tick log 3,906 B · 2c063bd4c0ff9a83f4c2330e2fd56ca85cbafc1a1e4a1f2295cf88ba822961cc
OrderBook log 32,077 B · 80c1173c4ea45d3bfbf500852e00dc468a2b4c0ab52cd63a000caf8db1c17147
Kline log 4,373 B · 49e154aff2d7478743184bda19d04da16e638c44b7f16f7d34606ad74cbf98c6
History log 13,991 B · b01f9ed8ad682b2091f56aa8443a69261066b111c94658456449314e6d1963f5
CSV exporter 5,706 B · a9e69e64e99e07d1a59cbb896e30255b5ae0356f0062a33b16b9658bbe512f1b