TT CORE SDK

The Instrument Class

The Instrument Class

The Instrument class provides the data as it relates to a given tradable security. Its members include methods such as:

    
virtual double  GetTickValue() const noexcept = 0;
virtual double  GetTickSize() 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;
                   

It also provides methods for performing arithmetic operations on prices, including:


                      
// returns the tradable price a number of ticks from the specified price
virtual double OffsetPrice (double price, int32_t offset, Rounding round) const noexcept = 0;

// returns the tradable price a number of ticks above the specified price
virtual double TickPriceUp (double price, int32_t offset) const noexcept = 0;

// returns the tradable price a number of ticks below the specified price
virtual double TickPriceDown (double price, int32_t offset) const noexcept = 0;

// returns the specified price rounded to a tradable tick
virtual double RoundPriceToTick (double price, Rounding round) const noexcept = 0;

// returns if the specified price is on a tradable tick
virtual bool IsPriceOnTick (const double price) const noexcept = 0;

// returns the specified price in tradable ticks
virtual int32_t PriceToTicks (const double price) const noexcept = 0;