dxFeed Graal CXX API v9.0.0
Loading...
Searching...
No Matches
NuamTrade Class Referencefinal

Represents an extension of Trade for the symbols traded on the Nuam Exchange. More...

#include <NuamTrade.hpp>

Inheritance diagram for NuamTrade:

Public Types

using Ptr = std::shared_ptr<NuamTrade>
 The alias to a type of shared pointer to the NuamTrade object.
using Unique = std::unique_ptr<NuamTrade>
 The alias to a type of unique pointer to the NuamTrade object.
Public Types inherited from Trade
using Ptr = std::shared_ptr<Trade>
 The alias to a type of shared pointer to the Trade object.
using Unique = std::unique_ptr<Trade>
 The alias to a type of unique pointer to the Trade object.
Public Types inherited from MarketEvent
using Ptr = std::shared_ptr<MarketEvent>
 The alias to a type of shared pointer to the MarketEvent object.
Public Types inherited from EventTypeWithSymbol< std::string >
using Ptr = std::shared_ptr<EventTypeWithSymbol<std::string>>
 The alias to a type of shared pointer to the EventTypeWithSymbol's child object.
Public Types inherited from EventType
using Ptr = std::shared_ptr<EventType>
 The alias to a type of shared pointer to the EventType object.
Public Types inherited from SharedEntity
using Ptr = std::shared_ptr<SharedEntity>
 The alias to a type of shared pointer to the SharedEntity object.
Public Types inherited from LastingEvent
using Ptr = std::shared_ptr<LastingEvent>
 The alias to a type of shared pointer to the LastingEvent object.

Public Member Functions

void * toGraal () const override
 Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
void assign (std::shared_ptr< EventType > event) override
 Replaces the contents of the event.
 NuamTrade () noexcept
 Creates new Nuam trade event with default values.
 NuamTrade (StringParam eventSymbol)
 Creates new Nuam trade event with the specified event symbol.
std::int64_t getTradeStatTime () const noexcept
 Returns time when trade statistics information was updated.
void setTradeStatTime (std::int64_t tradeStatTime) noexcept
 Changes time when trade statistics information was updated.
double getLastSignificantPrice () const noexcept
 Returns price of the last trade reported as significant by the exchange.
void setLastSignificantPrice (double lastSignificantPrice) noexcept
 Changes price of the last trade reported as significant by the exchange.
double getLastPriceForAll () const noexcept
 Returns price of the last trade (for all deals) reported by the exchange.
void setLastPriceForAll (double lastPriceForAll) noexcept
 Changes price of the last trade (for all deals) reported by the exchange.
std::int32_t getNumberOfTrades () const noexcept
 Returns number of trades reported by the exchange.
void setNumberOfTrades (std::int32_t numberOfTrades) noexcept
 Changes number of trades reported by the exchange.
double getVWAP () const noexcept
 Returns volume-weighted average price (VWAP) reported by the exchange.
void setVWAP (double vwap) noexcept
 Changes volume-weighted average price (VWAP) reported by the exchange.
std::string toString () const override
 Returns a string representation of the current object.
Public Member Functions inherited from Trade
void * toGraal () const override
 Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
void assign (std::shared_ptr< EventType > event) override
 Replaces the contents of the event.
 Trade () noexcept
 Creates new trade event with default values.
 Trade (StringParam eventSymbol)
 Creates a new trade event with the specified event symbol.
std::string toString () const override
 Returns a string representation of the current object.
Public Member Functions inherited from TradeBase
void assign (std::shared_ptr< EventType > event) override
 Replaces the contents of the event.
 TradeBase () noexcept
 Creates new trade event with default values.
 TradeBase (StringParam eventSymbol)
 Creates a new trade event with the specified event symbol.
std::int64_t getTimeSequence () const noexcept
 Returns time and sequence of the last trade packaged into a single long value.
void setTimeSequence (std::int64_t timeSequence) noexcept
 Changes time and sequence of last trade.
std::int64_t getTime () const noexcept
 Returns time of the last trade.
void setTime (std::int64_t time) noexcept
 Changes time of the last trade.
std::int64_t getTimeNanos () const noexcept
 Returns time of the last trade in nanoseconds.
void setTimeNanos (std::int64_t timeNanos) noexcept
 Changes time of the last trade.
void setTimeNanoPart (std::int32_t timeNanoPart) noexcept
 Changes microseconds and nanoseconds time part of the last trade.
std::int32_t getTimeNanoPart () const noexcept
 Returns microseconds and nanoseconds time part of the last trade.
std::int32_t getSequence () const noexcept
 Returns sequence number of the last trade to distinguish trades that have the same time.
void setSequence (std::int32_t sequence)
 Changes sequence number of the last trade.
std::int16_t getExchangeCode () const noexcept
 Returns exchange code of the last trade.
std::string getExchangeCodeString () const noexcept
 Returns exchange code of last trade as UTF8 string.
void setExchangeCode (char exchangeCode) noexcept
 Changes exchange code of the last trade.
void setExchangeCode (std::int16_t exchangeCode) noexcept
 Changes exchange code of the last trade.
std::int64_t getTradeId () const noexcept
 Returns trade ID of the last trade.
void setTradeId (std::int64_t tradeId) noexcept
 Changes trade ID of the last trade.
double getPrice () const noexcept
 Returns price of the last trade.
void setPrice (double price) noexcept
 Changes price of the last trade.
double getSize () const noexcept
 Returns size of the last trade as floating number with fractions.
void setSize (double size) noexcept
 Changes size of the last trade as floating number with fractions.
std::int32_t getDayId () const noexcept
 Returns identifier of the current trading day.
void setDayId (std::int32_t dayId) noexcept
 Changes identifier of the current trading day.
double getDayVolume () const noexcept
 Returns total volume traded for a day as floating number with fractions.
void setDayVolume (double dayVolume) noexcept
 Changes total volume traded for a day as floating number with fractions.
double getDayTurnover () const noexcept
 Returns total turnover traded for a day.
void setDayTurnover (double dayTurnover) noexcept
 Changes total turnover traded for a day.
const Direction & getTickDirection () const &noexcept
 Returns tick direction of the last trade.
void setTickDirection (const Direction &direction) noexcept
 Changes tick direction of the last trade.
bool isExtendedTradingHours () const noexcept
 Returns whether last trade was in extended trading hours.
void setExtendedTradingHours (bool extendedTradingHours) noexcept
 Changes whether last trade was in extended trading hours.
double getChange () const noexcept
 Returns change of the last trade.
void setChange (double change) noexcept
 Changes change of the last trade.
std::string baseFieldsToString () const
 Returns string representation of this trade event's fields.
Public Member Functions inherited from MarketEvent
const std::string & getEventSymbol () const &noexcept override
 Returns a symbol of this event.
const std::optional< std::string > & getEventSymbolOpt () const &noexcept override
 Returns a symbol of this event.
void setEventSymbol (StringParam eventSymbol) override
 Changes symbol of this event.
std::int64_t getEventTime () const noexcept override
 Returns time when an event was created or zero when time is not available.
void setEventTime (std::int64_t eventTime) noexcept override
 Changes event creation time.
Public Member Functions inherited from SharedEntity
template<typename T>
bool is () const noexcept
 Checks that the object is of type T: its dynamic type is T or derived from T.
template<typename T>
std::shared_ptr< T > sharedAs () noexcept
 Returns a pointer to the current object wrapped in a smart pointer to type T or std::shared_ptr<T>{nullptr} if the object is not managed by std::shared_ptr.
template<typename T>
std::shared_ptr< T > sharedAs () const noexcept
 Returns a pointer to the current object wrapped in a smart pointer to type T or std::shared_ptr<T>{nullptr} if the object is not managed by std::shared_ptr.
Public Member Functions inherited from Entity
virtual ~Entity () noexcept
 The default virtual d-tor.

Static Public Member Functions

static Ptr fromGraal (void *graalNative)
 Creates an object of the current type and fills it with data from the dxFeed Graal SDK structure.
static void freeGraal (void *graalNative)
 Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary).
Static Public Member Functions inherited from Trade
static Ptr fromGraal (void *graalNative)
 Creates an object of the current type and fills it with data from the dxFeed Graal SDK structure.
static void freeGraal (void *graalNative)
 Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary).

Static Public Attributes

static const EventTypeEnum & TYPE = EventTypeEnum::NUAM_TRADE
 Type identifier and additional information about the current event class.
Static Public Attributes inherited from Trade
static const EventTypeEnum & TYPE = EventTypeEnum::TRADE
 Type identifier and additional information about the current event class.
Static Public Attributes inherited from TradeBase
static constexpr std::uint32_t MAX_SEQUENCE = (1U << 22U) - 1U
 Maximum allowed sequence value.

Additional Inherited Members

Protected Member Functions inherited from MarketEvent
 MarketEvent (StringParam eventSymbol)
 Protected constructor for concrete implementation classes that initializes eventSymbol property.

Detailed Description

Represents an extension of Trade for the symbols traded on the Nuam Exchange.

It is the new Regional Holding that integrates the Santiago, Lima, and Colombia Stock Exchanges into a single market.

It includes the most recent information about Nuam trade statistics published after every trade for the current trading day such as number of trades, volume-weighted average price, etc.

Java: NuamTrade

Properties

NuamTrade event has all the properties of Trade and the following ones:

  • tradeStatTime - time when trade statistics information was updated;
  • lastSignificantPrice - price of the last trade reported as significant by the exchange;
  • lastPriceForAll - price of the last trade (for all deals) reported by the exchange;
  • numberOfTrades - number of trades reported by the exchange;
  • vwap - volume-weighted average price (VWAP) reported by the exchange.

Nuam trade statistics details

All extended fields beyond the Trade represent Nuam trade statistics. These statistics are sent by the exchange in a separate message following each trade message. For this reason, these fields are updated independently of last trade information. Use tradeStatTime and time to distinguish between last trade and trade statistics updates.

All Nuam trade statistics fields are populated using exchange data from Trade statistics messages. While price of Trade is expected to be identical to either lastPriceForAll or lastSignificantPrice, we added both fields to separate values from the exchange from our business logic of Trade event.

Implementation details

This event is implemented on top of QDS record NuamTrade.

Constructor & Destructor Documentation

◆ NuamTrade()

NuamTrade::NuamTrade ( StringParam eventSymbol)
explicit

Creates new Nuam trade event with the specified event symbol.

Parameters
eventSymbolThe event symbol.

Member Function Documentation

◆ assign()

void NuamTrade::assign ( std::shared_ptr< EventType > event)
overridevirtual

Replaces the contents of the event.

Parameters
eventthe event to use as a source.

Reimplemented from MarketEvent.

References Trade::assign().

◆ freeGraal()

void NuamTrade::freeGraal ( void * graalNative)
static

Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary).

Parameters
graalNativeThe pointer to the dxFeed Graal SDK structure.
Exceptions
InvalidArgumentException

◆ fromGraal()

NuamTrade::Ptr NuamTrade::fromGraal ( void * graalNative)
static

Creates an object of the current type and fills it with data from the dxFeed Graal SDK structure.

Parameters
graalNativeThe pointer to the dxFeed Graal SDK structure.
Returns
The object of the current type.
Exceptions
InvalidArgumentException

◆ getLastPriceForAll()

double NuamTrade::getLastPriceForAll ( ) const
noexcept

Returns price of the last trade (for all deals) reported by the exchange.

Unlike lastSignificantPrice, it represents the last trade price without any conditions.

Returns
price of the last trade (for all deals) reported by the exchange.

◆ getLastSignificantPrice()

double NuamTrade::getLastSignificantPrice ( ) const
noexcept

Returns price of the last trade reported as significant by the exchange.

For example, a trade cannot be considered significant if its price below 1000 USD.

Returns
price of the last trade reported as significant by the exchange.

◆ getNumberOfTrades()

std::int32_t NuamTrade::getNumberOfTrades ( ) const
noexcept

Returns number of trades reported by the exchange.

Returns
number of trades reported by the exchange.

◆ getTradeStatTime()

std::int64_t NuamTrade::getTradeStatTime ( ) const
noexcept

Returns time when trade statistics information was updated.

It can be used to distinguish between last trade and trade statistics updates. Time is measured in milliseconds between the current time and midnight, January 1, 1970 UTC.

Returns
time when trade statistics information was updated.

◆ getVWAP()

double NuamTrade::getVWAP ( ) const
noexcept

Returns volume-weighted average price (VWAP) reported by the exchange.

Returns
volume-weighted average price (VWAP) reported by the exchange.

◆ setLastPriceForAll()

void NuamTrade::setLastPriceForAll ( double lastPriceForAll)
noexcept

Changes price of the last trade (for all deals) reported by the exchange.

Parameters
lastPriceForAllprice of the last trade (for all deals) reported by the exchange.

◆ setLastSignificantPrice()

void NuamTrade::setLastSignificantPrice ( double lastSignificantPrice)
noexcept

Changes price of the last trade reported as significant by the exchange.

Parameters
lastSignificantPriceprice of the last trade reported as significant by the exchange.

◆ setNumberOfTrades()

void NuamTrade::setNumberOfTrades ( std::int32_t numberOfTrades)
noexcept

Changes number of trades reported by the exchange.

Parameters
numberOfTradesnumber of trades reported by the exchange.

◆ setTradeStatTime()

void NuamTrade::setTradeStatTime ( std::int64_t tradeStatTime)
noexcept

Changes time when trade statistics information was updated.

Time is measured in milliseconds between the current time and midnight, January 1, 1970 UTC.

Parameters
tradeStatTimetime when trade statistics information was updated.

◆ setVWAP()

void NuamTrade::setVWAP ( double vwap)
noexcept

Changes volume-weighted average price (VWAP) reported by the exchange.

Parameters
vwapvolume-weighted average price (VWAP) reported by the exchange.

◆ toGraal()

void * NuamTrade::toGraal ( ) const
overridevirtual

Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).

Fills the dxFeed Graal SDK structure's fields by the data of the current entity (recursively if necessary). Returns the pointer to the filled structure.

Returns
The pointer to the filled dxFeed Graal SDK structure

Implements EventType.

◆ toString()

std::string NuamTrade::toString ( ) const
overridevirtual

Returns a string representation of the current object.

Returns
a string representation

Reimplemented from EventType.