3 #include <tt_core_sdk/tt_core_sdk.hpp> 4 #include <tt_core_sdk/enums.hpp> 19 class ExecutionReportImpl;
20 class OrderCancelRejectImpl;
21 class OrderHandleImpl;
22 class OrderManagerImpl;
23 class SharedOrderManagerImpl;
40 double price = std::numeric_limits<double>::quiet_NaN();
52 uint32_t request_id = 0;
53 uint64_t request_time = 0;
54 double price = std::numeric_limits<double>::quiet_NaN();
65 class OrderHandle :
public std::enable_shared_from_this<OrderHandle>
79 explicit OrderHandle (std::unique_ptr<OrderHandleImpl>&&);
93 const std::string& GetOrderId (
void)
const noexcept;
96 double GetPrice (
void)
const noexcept;
99 int32_t GetOrderQuantity (
void)
const noexcept;
102 int32_t GetWorkingQuantity (
void)
const noexcept;
113 void ChangePrice (
double price, uint32_t request_id = 0);
118 void ChangeQuantity (int32_t
quantity, uint32_t request_id = 0);
124 void ChangePriceQuantity (
double price, int32_t quantity, uint32_t request_id = 0);
128 void DeleteOrder (uint32_t request_id = 0);
132 friend class OrderManagerImpl;
133 friend class SharedOrderManagerImpl;
135 std::unique_ptr<OrderHandleImpl> m_impl;
164 bool IsPending (
void)
const noexcept;
165 bool IsFill (
void)
const noexcept;
166 bool IsFullFill (
void)
const noexcept;
167 bool IsDelete (
void)
const noexcept;
168 bool IsReject (
void)
const noexcept;
169 bool IsTriggerActivated (
void)
const noexcept;
173 std::pair<bool, std::string> GetOrderId (
void)
const noexcept;
174 std::pair<bool, std::string> GetExecId (
void)
const noexcept;
175 std::pair<bool, order_status> GetOrderStatus (
void)
const noexcept;
176 std::pair<bool, exec_type> GetExecType (
void)
const noexcept;
177 std::pair<bool, order_type> GetOrderType (
void)
const noexcept;
178 std::pair<bool, order_side> GetSide (
void)
const noexcept;
179 std::pair<bool, time_in_force> GetTimeInForce (
void)
const noexcept;
180 std::pair<bool, double> GetPrice (
void)
const noexcept;
181 std::pair<bool, double> GetTriggerPrice (
void)
const noexcept;
182 std::pair<bool, int32_t> GetOrderQty (
void)
const noexcept;
183 std::pair<bool, int32_t> GetLeavesQty (
void)
const noexcept;
184 std::pair<bool, int32_t> GetCumQty (
void)
const noexcept;
185 std::pair<bool, int32_t> GetDisplayQty (
void)
const noexcept;
186 std::pair<bool, int32_t> GetRefreshQty (
void)
const noexcept;
190 std::pair<bool, double> GetLastFillPrice (
void)
const noexcept;
191 std::pair<bool, int32_t> GetLastFillQty (
void)
const noexcept;
195 std::pair<bool, uint64_t> GetUserId (
void)
const noexcept;
196 std::pair<bool, uint64_t> GetAccountId (
void)
const noexcept;
197 std::pair<bool, std::string> GetAccountName (
void)
const noexcept;
198 std::pair<bool, uint64_t> GetBrokerId (
void)
const noexcept;
202 std::pair<bool, uint64_t> GetInstrumentId (
void)
const noexcept;
203 std::pair<bool, market> GetMarket (
void)
const noexcept;
207 std::pair<bool, ord_rej_reason> GetOrderRejectReason (
void)
const noexcept;
208 std::pair<bool, reject_source> GetRejectSource (
void)
const noexcept;
209 std::pair<bool, reject_code> GetRejectCode (
void)
const noexcept;
210 std::pair<bool, std::string> GetText (
void)
const noexcept;
214 std::shared_ptr<ExecutionReportImpl> m_impl;
241 std::pair<bool, std::string> GetOrderId (
void)
const noexcept;
242 std::pair<bool, order_status> GetOrderStatus (
void)
const noexcept;
243 std::pair<bool, order_type> GetOrderType (
void)
const noexcept;
244 std::pair<bool, order_side> GetSide (
void)
const noexcept;
245 std::pair<bool, time_in_force> GetTimeInForce (
void)
const noexcept;
249 std::pair<bool, uint64_t> GetUserId (
void)
const noexcept;
250 std::pair<bool, uint64_t> GetAccountId (
void)
const noexcept;
251 std::pair<bool, std::string> GetAccountName (
void)
const noexcept;
252 std::pair<bool, uint64_t> GetBrokerId (
void)
const noexcept;
256 std::pair<bool, uint64_t> GetInstrumentId (
void)
const noexcept;
257 std::pair<bool, market> GetMarket (
void)
const noexcept;
261 std::pair<bool, cxl_rej_reason> GetCancelRejectReason (
void)
const noexcept;
262 std::pair<bool, reject_source> GetRejectSource (
void)
const noexcept;
263 std::pair<bool, reject_code> GetRejectCode (
void)
const noexcept;
264 std::pair<bool, std::string> GetText (
void)
const noexcept;
268 std::shared_ptr<OrderCancelRejectImpl> m_impl;
275 uint32_t request_id = 0;
281 std::shared_ptr<ExecutionReportImpl>);
288 uint32_t request_id = 0;
294 std::shared_ptr<OrderCancelRejectImpl>);
301 uint32_t request_id = 0;
309 uint32_t request_id = 0;
343 uint32_t request_id = 0;
345 bool download_complete =
false;
352 uint32_t request_id = 0;
353 std::vector<std::shared_ptr<OrderHandle>>
book;
359 uint32_t request_id = 0;
366 uint32_t request_id = 0;
433 void Subscribe (
const std::shared_ptr<OrderEventListener>& listener) noexcept;
440 void PlaceOrder (std::shared_ptr<OrderHandle>& handle, uint32_t request_id = 0);
451 void DownloadFills (uint8_t days = 7,
454 uint32_t request_id = 0);
459 void DownloadOrderBook (uint32_t request_id = 0);
463 std::shared_ptr<OrderManagerImpl> m_impl;
std::vector< std::shared_ptr< OrderHandle > > book
Container of orders in the book.
std::string message
Message describing the failure.
std::string message
Message describing the failure.
Interface for listening to order events.
POD definition of an order change request.
Response delivered through OrderEventListener.
Manages a set of orders and delivers order notifications.
Response delivered through OrderEventListener.
uint64_t time_sent_exchange
ExecutionReport er
Response details.
fill_receipt fill
Fill receipt data.
Response delivered through OrderEventListener.
std::shared_ptr< Instrument > instrument
Response delivered through OrderEventListener.
POD definition of an order to provide when submitting.
Response delivered through OrderEventListener.
std::shared_ptr< OrderHandle > handle
Order tied to the response.
uint64_t order_received_oc
Message receipt issued when a cancel or cancel/replace is rejected.
std::shared_ptr< OrderHandle > handle
Order tied to the response.
std::shared_ptr< OrderHandle > handle
Order tied to the response.
uint64_t received_from_exchange
OrderCancelReject ocr
Response details.
Outbound order message receipt.
std::shared_ptr< OrderHandle > handle
Order tied to the response.
Response delivered through OrderEventListener.
Represents the current state of the order.
Response delivered through OrderEventListener.