TT CORE SDK  0.1
TT CORE SDK documentation
tt_core_sdk::Instrument Class Reference

Definition of a contract on an exchange. More...

#include <instrument.hpp>

Collaboration diagram for tt_core_sdk::Instrument:

Classes

struct  instrument_leg
 Instrument legs. More...
 
struct  tick_table_data
 Variable ticking data. More...
 

Public Member Functions

bool IsValid (void) const noexcept
 Check if the instrument data is valid. More...
 
double OffsetPrice (double price, int32_t offset, rounding round) const noexcept
 Returns the tradable price a number of ticks from the specified price. More...
 
double TickPriceUp (double price, uint32_t offset) const noexcept
 Returns the tradable price a number of ticks above the specified price. More...
 
double TickPriceDown (double price, uint32_t offset) const noexcept
 Returns the tradable price a number of ticks below the specified price. More...
 
double RoundPriceToTick (double price, rounding round) const noexcept
 Returns the specified price rounded to a tradable tick. More...
 
double GetMinTickSize (void) const noexcept
 Returns the minimum tick size. More...
 
bool IsPriceOnTick (double price) const noexcept
 Returns if the specified price is on a tradable tick. More...
 
int32_t PriceToTicks (double price) const noexcept
 Returns the specified price in tradable ticks. More...
 

Public Attributes

uint64_t instr_id
 Instrument ID. More...
 
uint64_t instr_version
 Instrument version. More...
 
uint64_t synthetic_instr_id
 Synthetic Instrument ID. More...
 
uint64_t underlying_instr_id
 Underlying Instrument ID. More...
 
uint64_t algo_compliance_id
 Algo identifier for exchange compliance. More...
 
std::string name
 Instrument Name (e.g. ESZ4) More...
 
std::string alias
 Alias (e.g. ES Dec14) More...
 
std::string security_id
 Security ID. More...
 
std::string series_key
 Unique TT assigned ID. More...
 
enum market market_id
 Market Identifier. More...
 
std::string symbol
 Product Symbol (e.g. ES) More...
 
uint64_t product_id
 Product ID. More...
 
uint64_t product_version
 Product version. More...
 
enum product_type_id product_type_id
 Product type. More...
 
enum currency_code product_currency
 Native product currency. More...
 
double tick_value
 Value of one tick in the default currency. More...
 
double tick_size
 Interval between tradable prices. More...
 
uint32_t tick_num
 Ticking: Numerator. More...
 
uint32_t tick_denom
 Ticking: Denominator. More...
 
double point_value
 Value of one point in the default currency. More...
 
double display_factor
 Display Factor. More...
 
double min_price_increment
 Minimal price increment. More...
 
std::string price_topic
 The topic which price update is send on. More...
 
std::string price_formula
 User-defined price formula for a spread. More...
 
std::string implied_rules
 Implied rules. More...
 
uint32_t starting_date
 Starting date. More...
 
uint32_t last_trading_date
 Last trading date. More...
 
uint32_t first_delivery_date
 First delivery date. More...
 
uint32_t maturity_date
 Maturity date. More...
 
double strike_price
 Strike price. More...
 
uint16_t option_code_id
 Option code ID. More...
 
uint16_t option_scheme_id
 Option scheme ID. More...
 
uint16_t series_term_id
 Series term ID. More...
 
uint16_t combo_type_id
 Combo type ID. More...
 
bool supports_implieds
 Instrument supports implied prices. More...
 
bool is_not_tradable
 Instrument is not tradable. More...
 
struct tt_core_sdk::Instrument::tick_table_data tick_table
 
std::vector< instrument_leglegs
 

Static Public Attributes

static constexpr size_t MAX_TICK_TABLE_ROW_COUNT = 128
 Max supported tick table entries. More...
 
enum instr_state state
 Internal. More...
 
uint32_t update_source
 
uint32_t security_exchange_id
 
std::unique_ptr< opaque_data > opaque
 
bool IsAlgoVersion (const std::string &version) const noexcept
 
bool IsAlgoADL (void) const noexcept
 
bool IsAlgoSO (void) const noexcept
 
uint64_t KeyId (void) const noexcept
 

Detailed Description

Definition of a contract on an exchange.

Definition at line 14 of file instrument.hpp.

Member Function Documentation

◆ GetMinTickSize()

double tt_core_sdk::Instrument::GetMinTickSize ( void  ) const
noexcept

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

◆ IsAlgoADL()

bool tt_core_sdk::Instrument::IsAlgoADL ( void  ) const
noexcept

◆ IsAlgoSO()

bool tt_core_sdk::Instrument::IsAlgoSO ( void  ) const
noexcept

◆ IsAlgoVersion()

bool tt_core_sdk::Instrument::IsAlgoVersion ( const std::string &  version) const
noexcept

◆ IsPriceOnTick()

bool tt_core_sdk::Instrument::IsPriceOnTick ( double  price) const
noexcept

Returns if the specified price is on a tradable tick.

Parameters
[in]priceBase price

◆ IsValid()

bool tt_core_sdk::Instrument::IsValid ( void  ) const
noexcept

Check if the instrument data is valid.

◆ KeyId()

uint64_t tt_core_sdk::Instrument::KeyId ( void  ) const
noexcept

◆ OffsetPrice()

double tt_core_sdk::Instrument::OffsetPrice ( double  price,
int32_t  offset,
rounding  round 
) const
noexcept

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()

int32_t tt_core_sdk::Instrument::PriceToTicks ( double  price) const
noexcept

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()

double tt_core_sdk::Instrument::RoundPriceToTick ( double  price,
rounding  round 
) const
noexcept

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()

double tt_core_sdk::Instrument::TickPriceDown ( double  price,
uint32_t  offset 
) const
noexcept

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()

double tt_core_sdk::Instrument::TickPriceUp ( double  price,
uint32_t  offset 
) const
noexcept

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

Member Data Documentation

◆ algo_compliance_id

uint64_t tt_core_sdk::Instrument::algo_compliance_id

Algo identifier for exchange compliance.

Definition at line 80 of file instrument.hpp.

◆ alias

std::string tt_core_sdk::Instrument::alias

Alias (e.g. ES Dec14)

Definition at line 83 of file instrument.hpp.

◆ combo_type_id

uint16_t tt_core_sdk::Instrument::combo_type_id

Combo type ID.

Definition at line 115 of file instrument.hpp.

◆ display_factor

double tt_core_sdk::Instrument::display_factor

Display Factor.

Definition at line 99 of file instrument.hpp.

◆ first_delivery_date

uint32_t tt_core_sdk::Instrument::first_delivery_date

First delivery date.

Definition at line 108 of file instrument.hpp.

◆ implied_rules

std::string tt_core_sdk::Instrument::implied_rules

Implied rules.

Definition at line 104 of file instrument.hpp.

◆ instr_id

uint64_t tt_core_sdk::Instrument::instr_id

Instrument ID.

Definition at line 76 of file instrument.hpp.

◆ instr_version

uint64_t tt_core_sdk::Instrument::instr_version

Instrument version.

Definition at line 77 of file instrument.hpp.

◆ is_not_tradable

bool tt_core_sdk::Instrument::is_not_tradable

Instrument is not tradable.

Definition at line 118 of file instrument.hpp.

◆ last_trading_date

uint32_t tt_core_sdk::Instrument::last_trading_date

Last trading date.

Definition at line 107 of file instrument.hpp.

◆ legs

std::vector<instrument_leg> tt_core_sdk::Instrument::legs

Definition at line 148 of file instrument.hpp.

◆ market_id

enum market tt_core_sdk::Instrument::market_id

Market Identifier.

Definition at line 87 of file instrument.hpp.

◆ maturity_date

uint32_t tt_core_sdk::Instrument::maturity_date

Maturity date.

Definition at line 109 of file instrument.hpp.

◆ MAX_TICK_TABLE_ROW_COUNT

constexpr size_t tt_core_sdk::Instrument::MAX_TICK_TABLE_ROW_COUNT = 128
static

Max supported tick table entries.

Definition at line 17 of file instrument.hpp.

◆ min_price_increment

double tt_core_sdk::Instrument::min_price_increment

Minimal price increment.

Definition at line 100 of file instrument.hpp.

◆ name

std::string tt_core_sdk::Instrument::name

Instrument Name (e.g. ESZ4)

Definition at line 82 of file instrument.hpp.

◆ opaque

std::unique_ptr<opaque_data> tt_core_sdk::Instrument::opaque

Definition at line 154 of file instrument.hpp.

◆ option_code_id

uint16_t tt_core_sdk::Instrument::option_code_id

Option code ID.

Definition at line 112 of file instrument.hpp.

◆ option_scheme_id

uint16_t tt_core_sdk::Instrument::option_scheme_id

Option scheme ID.

Definition at line 113 of file instrument.hpp.

◆ point_value

double tt_core_sdk::Instrument::point_value

Value of one point in the default currency.

Definition at line 98 of file instrument.hpp.

◆ price_formula

std::string tt_core_sdk::Instrument::price_formula

User-defined price formula for a spread.

Definition at line 103 of file instrument.hpp.

◆ price_topic

std::string tt_core_sdk::Instrument::price_topic

The topic which price update is send on.

Definition at line 102 of file instrument.hpp.

◆ product_currency

enum currency_code tt_core_sdk::Instrument::product_currency

Native product currency.

Definition at line 92 of file instrument.hpp.

◆ product_id

uint64_t tt_core_sdk::Instrument::product_id

Product ID.

Definition at line 89 of file instrument.hpp.

◆ product_type_id

enum product_type_id tt_core_sdk::Instrument::product_type_id

Product type.

Definition at line 91 of file instrument.hpp.

◆ product_version

uint64_t tt_core_sdk::Instrument::product_version

Product version.

Definition at line 90 of file instrument.hpp.

◆ security_exchange_id

uint32_t tt_core_sdk::Instrument::security_exchange_id

Definition at line 153 of file instrument.hpp.

◆ security_id

std::string tt_core_sdk::Instrument::security_id

Security ID.

Definition at line 84 of file instrument.hpp.

◆ series_key

std::string tt_core_sdk::Instrument::series_key

Unique TT assigned ID.

Definition at line 85 of file instrument.hpp.

◆ series_term_id

uint16_t tt_core_sdk::Instrument::series_term_id

Series term ID.

Definition at line 114 of file instrument.hpp.

◆ starting_date

uint32_t tt_core_sdk::Instrument::starting_date

Starting date.

Definition at line 106 of file instrument.hpp.

◆ state

enum instr_state tt_core_sdk::Instrument::state

Internal.

Definition at line 151 of file instrument.hpp.

◆ strike_price

double tt_core_sdk::Instrument::strike_price

Strike price.

Definition at line 111 of file instrument.hpp.

◆ supports_implieds

bool tt_core_sdk::Instrument::supports_implieds

Instrument supports implied prices.

Definition at line 117 of file instrument.hpp.

◆ symbol

std::string tt_core_sdk::Instrument::symbol

Product Symbol (e.g. ES)

Definition at line 88 of file instrument.hpp.

◆ synthetic_instr_id

uint64_t tt_core_sdk::Instrument::synthetic_instr_id

Synthetic Instrument ID.

Definition at line 78 of file instrument.hpp.

◆ tick_denom

uint32_t tt_core_sdk::Instrument::tick_denom

Ticking: Denominator.

Definition at line 97 of file instrument.hpp.

◆ tick_num

uint32_t tt_core_sdk::Instrument::tick_num

Ticking: Numerator.

Definition at line 96 of file instrument.hpp.

◆ tick_size

double tt_core_sdk::Instrument::tick_size

Interval between tradable prices.

Definition at line 95 of file instrument.hpp.

◆ tick_table

struct tt_core_sdk::Instrument::tick_table_data tt_core_sdk::Instrument::tick_table

◆ tick_value

double tt_core_sdk::Instrument::tick_value

Value of one tick in the default currency.

Definition at line 94 of file instrument.hpp.

◆ underlying_instr_id

uint64_t tt_core_sdk::Instrument::underlying_instr_id

Underlying Instrument ID.

Definition at line 79 of file instrument.hpp.

◆ update_source

uint32_t tt_core_sdk::Instrument::update_source

Definition at line 152 of file instrument.hpp.


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