TT CORE SDK 2.0.1.1
TT CORE SDK documentation
Loading...
Searching...
No Matches
ttsdk::Instrument Class Referenceabstract

#include <instrument.h>

Inheritance diagram for ttsdk::Instrument:
Collaboration diagram for ttsdk::Instrument:

Public Types

enum class  ResponseCode {
  SUCCESS = 0 , FAILED = 1 , INVALID_REQUEST = 2 , NOT_ALLOWED = 3 ,
  THROTTLE_EXCEEDED = 4 , NOT_FOUND = 5
}
 
enum  State { DELETED = 1 , INACTIVE = 2 , ACTIVE = 4 }
 
enum  Rounding { NONE , UP , DOWN , NEAREST }
 

Public Member Functions

virtual double OffsetPrice (double price, int32_t offset, Rounding round) const noexcept=0
 Returns the tradable price a number of ticks from the specified price.
 
virtual double TickPriceUp (double price, int32_t offset) const noexcept=0
 Returns the tradable price a number of ticks above the specified price.
 
virtual double TickPriceDown (double price, int32_t offset) const noexcept=0
 Returns the tradable price a number of ticks below the specified price.
 
virtual double RoundPriceToTick (double price, Rounding round) const noexcept=0
 Returns the specified price rounded to a tradable tick.
 
virtual double GetMinTickSize () const noexcept=0
 Returns the minimum tick size.
 
virtual bool IsPriceOnTick (const double price) const noexcept=0
 Returns if the specified price is on a tradable tick.
 
virtual int32_t PriceToTicks (const double price) const noexcept=0
 Returns the specified price in tradable ticks.
 
virtual State GetState () const noexcept=0
 
virtual uint64_t GetInstrumentId () const noexcept=0
 
virtual const charGetName () const noexcept=0
 
virtual const charGetAlias () const noexcept=0
 
virtual const charGetSecurityId () const noexcept=0
 
virtual uint32_t GetSecurityExchangeId () const noexcept=0
 
virtual ProductType GetProductType () const noexcept=0
 
virtual MarketId GetMarket () const noexcept=0
 
virtual CurrencyCode GetCurrencyCode () const noexcept=0
 
virtual const charGetProductName () const noexcept=0
 
virtual const charGetProductSymbol () const noexcept=0
 
virtual double GetTickValue () const noexcept=0
 
virtual double GetTickSize () const noexcept=0
 
virtual double GetTickSize (const double price) const noexcept=0
 
virtual int64_t GetTickNum () const noexcept=0
 
virtual int64_t GetTickDenom () const noexcept=0
 
virtual double GetPointValue () const noexcept=0
 
virtual double GetDisplayFactor () const noexcept=0
 
virtual uint64_t GetStartingDate () const noexcept=0
 
virtual uint64_t GetLastTradingDate () const noexcept=0
 
virtual uint64_t GetFirstDeliveryDate () const noexcept=0
 
virtual uint64_t GetMaturityDate () const noexcept=0
 
virtual PriceDisplayType GetPriceDisplayType () const noexcept=0
 
virtual size_t GetNumberLegs () const noexcept=0
 
virtual InstrumentLegPtr GetLeg (const uint32_t index) const noexcept=0
 
 Instrument ()
 
- Public Member Functions inherited from ttsdk::shared_base
 shared_base ()
 
virtual ~shared_base ()
 
int dec_ref () const
 
void inc_ref () const
 
virtual void del_ref () const
 

Detailed Description

Definition at line 55 of file instrument.h.

Member Enumeration Documentation

◆ ResponseCode

Enumerator
SUCCESS 
FAILED 
INVALID_REQUEST 
NOT_ALLOWED 
THROTTLE_EXCEEDED 
NOT_FOUND 

Definition at line 58 of file instrument.h.

◆ Rounding

Enumerator
NONE 

Do not round the price.

UP 

Round the price up to the next tradable price.

DOWN 

Round the price down to the next tradable price.

NEAREST 

Round the price to the nearest tradable price, whether up or down.

Definition at line 73 of file instrument.h.

◆ State

Enumerator
DELETED 
INACTIVE 
ACTIVE 

Definition at line 67 of file instrument.h.

Constructor & Destructor Documentation

◆ Instrument()

ttsdk::Instrument::Instrument ( )
inline

Definition at line 165 of file instrument.h.

Member Function Documentation

◆ GetAlias()

virtual const char * ttsdk::Instrument::GetAlias ( ) const
pure virtualnoexcept

◆ GetCurrencyCode()

virtual CurrencyCode ttsdk::Instrument::GetCurrencyCode ( ) const
pure virtualnoexcept

◆ GetDisplayFactor()

virtual double ttsdk::Instrument::GetDisplayFactor ( ) const
pure virtualnoexcept

◆ GetFirstDeliveryDate()

virtual uint64_t ttsdk::Instrument::GetFirstDeliveryDate ( ) const
pure virtualnoexcept

◆ GetInstrumentId()

virtual uint64_t ttsdk::Instrument::GetInstrumentId ( ) const
pure virtualnoexcept

◆ GetLastTradingDate()

virtual uint64_t ttsdk::Instrument::GetLastTradingDate ( ) const
pure virtualnoexcept

◆ GetLeg()

virtual InstrumentLegPtr ttsdk::Instrument::GetLeg ( const uint32_t index) const
pure virtualnoexcept

◆ GetMarket()

virtual MarketId ttsdk::Instrument::GetMarket ( ) const
pure virtualnoexcept

◆ GetMaturityDate()

virtual uint64_t ttsdk::Instrument::GetMaturityDate ( ) const
pure virtualnoexcept

◆ GetMinTickSize()

virtual double ttsdk::Instrument::GetMinTickSize ( ) const
pure virtualnoexcept

Returns the minimum tick size.

If the instruments supports variable ticking, the result may differ from the tick_size property.

Returns
Minimum tick size for this instrument

◆ GetName()

virtual const char * ttsdk::Instrument::GetName ( ) const
pure virtualnoexcept

◆ GetNumberLegs()

virtual size_t ttsdk::Instrument::GetNumberLegs ( ) const
pure virtualnoexcept

◆ GetPointValue()

virtual double ttsdk::Instrument::GetPointValue ( ) const
pure virtualnoexcept

◆ GetPriceDisplayType()

virtual PriceDisplayType ttsdk::Instrument::GetPriceDisplayType ( ) const
pure virtualnoexcept

◆ GetProductName()

virtual const char * ttsdk::Instrument::GetProductName ( ) const
pure virtualnoexcept

◆ GetProductSymbol()

virtual const char * ttsdk::Instrument::GetProductSymbol ( ) const
pure virtualnoexcept

◆ GetProductType()

virtual ProductType ttsdk::Instrument::GetProductType ( ) const
pure virtualnoexcept

◆ GetSecurityExchangeId()

virtual uint32_t ttsdk::Instrument::GetSecurityExchangeId ( ) const
pure virtualnoexcept

◆ GetSecurityId()

virtual const char * ttsdk::Instrument::GetSecurityId ( ) const
pure virtualnoexcept

◆ GetStartingDate()

virtual uint64_t ttsdk::Instrument::GetStartingDate ( ) const
pure virtualnoexcept

◆ GetState()

virtual State ttsdk::Instrument::GetState ( ) const
pure virtualnoexcept

◆ GetTickDenom()

virtual int64_t ttsdk::Instrument::GetTickDenom ( ) const
pure virtualnoexcept

◆ GetTickNum()

virtual int64_t ttsdk::Instrument::GetTickNum ( ) const
pure virtualnoexcept

◆ GetTickSize() [1/2]

virtual double ttsdk::Instrument::GetTickSize ( ) const
pure virtualnoexcept

◆ GetTickSize() [2/2]

virtual double ttsdk::Instrument::GetTickSize ( const double price) const
pure virtualnoexcept

◆ GetTickValue()

virtual double ttsdk::Instrument::GetTickValue ( ) const
pure virtualnoexcept

◆ IsPriceOnTick()

virtual bool ttsdk::Instrument::IsPriceOnTick ( const double price) const
pure virtualnoexcept

Returns if the specified price is on a tradable tick.

Parameters
[in]priceBase price

◆ OffsetPrice()

virtual double ttsdk::Instrument::OffsetPrice ( double price,
int32_t offset,
Rounding round ) const
pure virtualnoexcept

Returns the tradable price a number of ticks from the specified price.

You can use this function to find a price a number of price levels away from a specified price. For example, if this price represents the last-traded price, you could use this method to get the price two ticks higher (or lower).
This function applies the offset value to the specified price and then applies the rounding method to arrive at the tradable price. For example, suppose you specify a base price that is not tradable with an offset of -3 and want to round the price up. The function first drops the price by three ticks and then rounds the new price up to the next tradable tick.

Parameters
[in]priceBase price
[in]offsetNumber of ticks away from the base price
[in]roundRounding method to use
Returns
A valid tradable price

◆ PriceToTicks()

virtual int32_t ttsdk::Instrument::PriceToTicks ( const double price) const
pure virtualnoexcept

Returns the specified price in tradable ticks.

Parameters
[in]priceBase price
Note
If price does not fall on a tradable tick, it will be rounded to a tradable tick (rounded down for positive prices and up for negative prices). Invalid input will return 0.
Returns
Number of ticks for the provided price

◆ RoundPriceToTick()

virtual double ttsdk::Instrument::RoundPriceToTick ( double price,
Rounding round ) const
pure virtualnoexcept

Returns the specified price rounded to a tradable tick.

Parameters
[in]priceBase price (to round to a tradable tick)
[in]roundRounding method to use
Returns
A valid tradable price

◆ TickPriceDown()

virtual double ttsdk::Instrument::TickPriceDown ( double price,
int32_t offset ) const
pure virtualnoexcept

Returns the tradable price a number of ticks below the specified price.

Parameters
[in]priceBase price
[in]offsetNumber of ticks below the base price
Returns
A valid tradable price

◆ TickPriceUp()

virtual double ttsdk::Instrument::TickPriceUp ( double price,
int32_t offset ) const
pure virtualnoexcept

Returns the tradable price a number of ticks above the specified price.

Parameters
[in]priceBase price
[in]offsetNumber of ticks above the base price
Returns
A valid tradable price

The documentation for this class was generated from the following file: