Skip to main content

Module overnight_whitelist

Module overnight_whitelist 

Source
Expand description

v1.4.113 US overnight order parity: CMD20874 dynamic overnight white list. 给 C++ AdjustTradeSession 的 Session_ALL → ALL_DAY/ETH 分支提供 broker+stock_id cache. CMD20874 QryNightWhitelistClient — dynamic overnight white list.

C++ source of truth:

  • NNProtoCenter/Trade/NNProto_Trd_OvernightWhiteList.cpp
  • NNDataCenter/Trade/NNData_Trd_OvernightWhiteList.cpp
  • FTGateway/GTWCmdAndPushReply.cpp::Timer_PullOvernightWhiteList

OpenD startup loads cached overnight_white_list.dat, then periodically sends CMD20874 per broker. AdjustTradeSession uses the in-memory IsStockInWhiteList(enBroker, secInfo.nSecID) result: Session_ALL stays ALL_DAY only for broker+stock IDs in this list; otherwise it downgrades to ETH.

§Hardcoded / Assumption Ledger

  • CMD20874 is NN_ProtoCmd_Trd_OvernightWhiteList, from C++ NNBase_Define_ProtoCmd.h.
  • Valid brokers {1001,1007,1008,1009} are copied from C++ NNData_Trd_OvernightWhiteList.cpp::IsValidBrokerID (Futu HK/US/SG/AU).
  • stock_id_list is gzip-compressed bytes containing native uint64_t stock IDs. Official OpenD targets little-endian macOS/Windows in our test matrix, so Rust decodes explicit little-endian u64 chunks rather than host-native order.
  • Current BackendConn::request does not expose C++ nExtErrCode == -1009 cache-match replies. A decode/fetch error leaves the last cache intact; normal response updates remain dynamic.

Structs§

OvernightWhitelistCache
Shared per-broker overnight whitelist cache.
OvernightWhitelistSnapshot
Decoded CMD20874 response.

Constants§

CMD_TRD_OVERNIGHT_WHITE_LIST
CMD20874 NN_ProtoCmd_Trd_OvernightWhiteList.
DEFAULT_UPDATE_INTERVAL_SECS
C++ fallback interval in OMEvProc_OvernightWhiteList when backend does not provide a usable update_interval.
MIN_UPDATE_INTERVAL_SECS
Minimum refresh interval guard for malformed backend values.

Functions§

build_overnight_whitelist_request
is_valid_overnight_whitelist_broker
normalized_update_interval
parse_overnight_whitelist_rsp
refresh_overnight_whitelist
unpack_stock_id_list_gzip