After the subscription starts, TT Core SDK invokes the event handler method you registered with the subscription for every price update passing an instance of a PriceSnap struct. The PriceSnap struct contains members for each element of market data, such as:
double open_price = NAN;
double close_price = NAN;
double high_price = NAN;
double low_price = NAN;
double last_trade_price = NAN;
double last_trade_quantity = NAN;
double volume = NAN;
double cum_last_trade_quantity = NAN;
double settlement_price = NAN;
double open_interest = NAN;
It also contains an array of the DepthLevel struct for bid depth and an array of the DepthLevel struct for ask depth.
struct DepthSnap
{
// a single level of the total depth
struct DepthLevel
{
double price; //!
std::string to_string(const ttsdk::PriceSnap& snap)
{
std::ostringstream ss;
if (snap.event_type == ttsdk::PriceEventType::DIRECT)
ss 0 || snap.bids.count > 0)
{
ss = 0; --i)
{
const auto& level = snap.asks.levels[i];
ss