3 #include <tt_core_sdk/enums.hpp> 14 class InProcessComposerImpl;
15 class InProcessUnifierImpl;
130 static constexpr
Filter PRICE_FILTER_NONE { 0 };
131 static constexpr
Filter PRICE_FILTER_MARKET_STATE { 1 };
132 static constexpr
Filter PRICE_FILTER_ASK0 { 1 << 1 };
133 static constexpr
Filter PRICE_FILTER_ASK1 { 1 << 2 };
134 static constexpr
Filter PRICE_FILTER_ASK2 { 1 << 3 };
135 static constexpr
Filter PRICE_FILTER_ASK3 { 1 << 4 };
136 static constexpr
Filter PRICE_FILTER_ASK4 { 1 << 5 };
137 static constexpr
Filter PRICE_FILTER_ASK5 { 1 << 6 };
138 static constexpr
Filter PRICE_FILTER_ASK6 { 1 << 7 };
139 static constexpr
Filter PRICE_FILTER_ASK7 { 1 << 8 };
140 static constexpr
Filter PRICE_FILTER_ASK8 { 1 << 9 };
141 static constexpr
Filter PRICE_FILTER_ASK9 { 1 << 10 };
142 static constexpr
Filter PRICE_FILTER_BID0 { 1 << 11 };
143 static constexpr
Filter PRICE_FILTER_BID1 { 1 << 12 };
144 static constexpr
Filter PRICE_FILTER_BID2 { 1 << 13 };
145 static constexpr
Filter PRICE_FILTER_BID3 { 1 << 14 };
146 static constexpr
Filter PRICE_FILTER_BID4 { 1 << 15 };
147 static constexpr
Filter PRICE_FILTER_BID5 { 1 << 16 };
148 static constexpr
Filter PRICE_FILTER_BID6 { 1 << 17 };
149 static constexpr
Filter PRICE_FILTER_BID7 { 1 << 18 };
150 static constexpr
Filter PRICE_FILTER_BID8 { 1 << 19 };
151 static constexpr
Filter PRICE_FILTER_BID9 { 1 << 20 };
152 static constexpr
Filter PRICE_FILTER_OPEN { 1 << 21 };
153 static constexpr
Filter PRICE_FILTER_CLOSE { 1 << 22 };
154 static constexpr
Filter PRICE_FILTER_HIGH { 1 << 23 };
155 static constexpr
Filter PRICE_FILTER_LOW { 1 << 24 };
156 static constexpr
Filter PRICE_FILTER_LAST_TRADE_PRICE { 1 << 25 };
157 static constexpr
Filter PRICE_FILTER_LAST_TRADE_QTY { 1 << 26 };
158 static constexpr
Filter PRICE_FILTER_VOLUME { 1 << 27 };
159 static constexpr
Filter PRICE_FILTER_SETTLEMENT { 1 << 28 };
160 static constexpr
Filter PRICE_FILTER_TIME_SALES { 1 << 29 };
161 static constexpr
Filter PRICE_FILTER_NO_IMPLIES { 1 << 30 };
162 static constexpr
Filter PRICE_FILTER_ALL_ASK { 0x7FE };
163 static constexpr
Filter PRICE_FILTER_ALL_BID { 0x1FF800 };
164 static constexpr
Filter PRICE_FILTER_ALL_DEPTH { 0x1FFFFE };
165 static constexpr
Filter PRICE_FILTER_ALL_PRICE_FIELD { 0x1FFFFFFF };
166 static constexpr
Filter PRICE_FILTER_ALL { 0x3FFFFFFF };
167 static constexpr
Filter PRICE_FILTER_PNL { 0x12400803 };
183 virtual void OnPriceUpdate (
const PriceSnap& snap) = 0;
188 virtual void OnTimeSalesUpdate (
const TimeSale& ts) = 0;
192 virtual void OnError (
const std::string& error) = 0;
229 uint64_t
Id (
void)
const noexcept {
return m_id; }
234 bool IsValid (
void)
const noexcept;
251 Filter GetFilter (
void)
const noexcept;
252 void SetFilter (
const Filter& filter) noexcept;
253 void AddFilter (
const Filter& additional_filter) noexcept;
258 friend class PriceLibImpl;
259 friend class InProcessComposerImpl;
260 friend class InProcessUnifierImpl;
261 friend class InProcessPriceTCPImpl;
262 friend class PriceClientTCP;
264 using FilterPtr = std::shared_ptr<std::atomic<Filter>>;
285 const std::shared_ptr<PriceEventListener>& listener);
depth_snap bids
Price feed depth.
Manages a price subscription.
uint64_t before_callback_time
uint64_t epoch_transact_time_nano
Transaction Time Since Epoch (ns)
uint64_t exchange_time_ns
Internal.
static constexpr size_t MAX_DEPTH_LEVEL
Max supported levels of depth.
bool is_implied
Trade is implied.
uint64_t after_merge_time
int32_t order_count
Number of orders that make up the total quantity.
std::string to_string(instr_state)
TT Core SDK enum to_string conversions.
Time and Sales update data.
uint64_t order_stimulus_received_algo
double last_trade_price
Last Traded Price (NAN when unavailable)
uint64_t seq_no
Price snapshot properties.
uint64_t exchange_transaction_time_ns
int32_t quantity
Total quantity at this level.
uint64_t after_parse_time
double close_price
Close price (NAN when unavailable)
double last_trade_price
Time and Sales snapshot properties.
uint64_t Id(void) const noexcept
Unique PriceSubscription ID.
uint64_t before_parse_time
uint64_t conflation_no
Price conflation count.
trade_type
Type of trade triggering the update.
double volume
Total contract volume.
double last_trade_quantity
Last traded quantity (NAN when unavailable)
trade_qualifier qualifier
bool is_otc
Time and Sales data flags.
uint64_t exchange_transact_time_ns
Internal.
size_t count
Number of available price depth levels.
int32_t implied_quantity
Implied quantity contributing to the total quantity.
Interface for listening to price subscription events.
uint64_t after_cache_time
double last_trade_quantity
Last traded quantity (NAN when unavailable)
uint64_t epoch_transact_time_micro
Transaction Time Since Epoch (us)
trade_type type
Trade type.
enum market_state market_state
Market State.
Snapshot of the market depth.
uint64_t client_recv_time
std::bitset< 30 > Filter
Bitmask specifying which price updates trigger event notifications.
A single level of the total depth.
double high_price
High price (NAN when unavailable)
market_state
Market State.
PriceSubscription CreatePriceSubscription(const std::shared_ptr< Instrument > &instr, const Filter &filter, const std::shared_ptr< PriceEventListener > &listener)
Create a price subscription.
trade_status status
Trade Status.
double open_price
Price feed properties.
double low_price
Low price (NAN when unavailable)
struct tt_core_sdk::PriceSnap::depth_snap::depth_level levels[MAX_DEPTH_LEVEL]