TT CORE SDK 2.0.1.1
TT CORE SDK documentation
Loading...
Searching...
No Matches
instrument.h
Go to the documentation of this file.
1/***************************************************************************
2 *
3 * Unpublished Work Copyright (c) 2018-2020
4 * Trading Technologies International, Inc.
5 * All Rights Reserved Worldwide
6 *
7 * * * * S T R I C T L Y P R O P R I E T A R Y * * *
8 *
9 * WARNING: This program (or document) is unpublished, proprietary property
10 * of Trading Technologies International, Inc. and is to be maintained in
11 * strict confidence. Unauthorized reproduction, distribution or disclosure
12 * of this program (or document), or any program (or document) derived from
13 * it is prohibited by State and Federal law, and by local law outside of
14 * the U.S.
15 *
16 ***************************************************************************/
17#pragma once
18
19#include <stddef.h>
20#include "shared_ptr.h"
21#include "enums/MarketId.h"
22#include "enums/CurrencyCode.h"
23#include "enums/ProductType.h"
25
26/*
27#ifdef _AFXDLL
28
29#pragma warning(disable: 4275) // deriving exported class from non-exported
30
31#pragma warning(disable: 4251) // using non-exported as public in exported
32
33#endif
34
35*/
36namespace ttsdk {
37
39 {
40 public:
41 virtual uint64_t GetInstrumentId() const noexcept = 0;
42 virtual const char* GetName() const noexcept = 0;
43 virtual MarketId GetMarket() const noexcept = 0;
44 virtual int32_t GetRatio() const noexcept = 0;
45 virtual float GetStrike() const noexcept = 0;
47 private:
48 InstrumentLeg(InstrumentLeg&&) = delete;
49 InstrumentLeg& operator= (InstrumentLeg&&) = delete;
50 };
52 template class shared_ptr<const InstrumentLeg>;
53
54
55 class Instrument : public shared_base
56 {
57 public:
58 enum class ResponseCode
59 {
60 SUCCESS = 0,
61 FAILED = 1,
62 INVALID_REQUEST = 2,
63 NOT_ALLOWED = 3,
64 THROTTLE_EXCEEDED = 4,
65 NOT_FOUND = 5,
66 };
67 enum State
68 {
69 DELETED = 1,
70 INACTIVE = 2,
71 ACTIVE = 4
72 };
74 {
78 NEAREST
79 };
80 // Ticking methods
97 virtual double OffsetPrice (double price, int32_t offset, Rounding round) const noexcept = 0;
98
103 virtual double TickPriceUp (double price, int32_t offset) const noexcept = 0;
104
109 virtual double TickPriceDown (double price, int32_t offset) const noexcept = 0;
110
115 virtual double RoundPriceToTick (double price, Rounding round) const noexcept = 0;
116
121 virtual double GetMinTickSize () const noexcept = 0;
122
125 virtual bool IsPriceOnTick (const double price) const noexcept = 0;
126
133 virtual int32_t PriceToTicks (const double price) const noexcept = 0;
134
135 // Data members
136 virtual State GetState() const noexcept = 0;
137 virtual uint64_t GetInstrumentId() const noexcept = 0;
138 virtual const char* GetName() const noexcept = 0;
139 virtual const char* GetAlias() const noexcept = 0;
140 virtual const char* GetSecurityId() const noexcept = 0;
141 virtual uint32_t GetSecurityExchangeId() const noexcept = 0;
142 virtual ProductType GetProductType() const noexcept = 0;
143 virtual MarketId GetMarket() const noexcept = 0;
144 virtual CurrencyCode GetCurrencyCode() const noexcept = 0;
145 virtual const char* GetProductName() const noexcept = 0;
146 virtual const char* GetProductSymbol() const noexcept = 0;
147
148 virtual double GetTickValue() const noexcept = 0;
149 virtual double GetTickSize() const noexcept = 0;
150 virtual double GetTickSize(const double price) const noexcept = 0;
151 virtual int64_t GetTickNum() const noexcept = 0;
152 virtual int64_t GetTickDenom() const noexcept = 0;
153 virtual double GetPointValue() const noexcept = 0;
154 virtual double GetDisplayFactor() const noexcept = 0;
155
156 virtual uint64_t GetStartingDate() const noexcept = 0;
157 virtual uint64_t GetLastTradingDate() const noexcept = 0;
158 virtual uint64_t GetFirstDeliveryDate() const noexcept = 0;
159 virtual uint64_t GetMaturityDate() const noexcept = 0;
160 virtual PriceDisplayType GetPriceDisplayType() const noexcept = 0;
161
162 virtual size_t GetNumberLegs() const noexcept = 0;
163 virtual InstrumentLegPtr GetLeg(const uint32_t index) const noexcept = 0;
164
166 private:
167 Instrument(Instrument&&) = delete;
168 Instrument& operator= (Instrument&&) = delete;
169 };
170
172
173}
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 TickPriceDown(double price, int32_t offset) const noexcept=0
Returns the tradable price a number of ticks below the specified price.
virtual double GetMinTickSize() const noexcept=0
Returns the minimum tick size.
virtual double RoundPriceToTick(double price, Rounding round) const noexcept=0
Returns the specified price rounded to a tradable tick.
@ DOWN
Round the price down to the next tradable price.
Definition instrument.h:77
@ UP
Round the price up to the next tradable price.
Definition instrument.h:76
@ NONE
Do not round the price.
Definition instrument.h:75
virtual double TickPriceUp(double price, int32_t offset) const noexcept=0
Returns the tradable price a number of ticks above the specified price.
virtual uint64_t GetInstrumentId() const noexcept=0
virtual float GetStrike() const noexcept=0
virtual const char * GetName() const noexcept=0
virtual int32_t GetRatio() const noexcept=0
virtual MarketId GetMarket() const noexcept=0
MarketId
Definition MarketId.h:29