After the subscription starts, TT Core SDK invokes the event handler method you registered with the subscription for every Time & Sales update passing an instance of a TimeSales struct. The TimeSales struct contains an array of Trade struct instances where each contains the data corresponding to a trade that occurred in the market, including:
double last_trade_price = NAN;
double last_trade_quantity = NAN;
ttsdk::TradeType trade_side;
uint64_t epoch_transact_time_nano;
uint64_t exchange_transact_time_ns;
In other words, you will receive data for one or more trades when this callback is fired. The following code snippet demonstrates how to process a price subscription update.
std::string to_string(const ttsdk::TimeSales& ts)
{
std::ostringstream ss;
if (ts.event_type == ttsdk::PriceEventType::DIRECT)
ss