TT CORE SDK 2.0.2.1
TT CORE SDK documentation
ttsdk::IOrderBookEventHandler Class Referenceabstract

Interface for listening to order and position events. There is one OrderBookEventHandler set in the SDK. All order events will go to this handler unless a specific handler is set for specific orders on an order by order basis. More...

#include <order.h>

Inheritance diagram for ttsdk::IOrderBookEventHandler:
Collaboration diagram for ttsdk::IOrderBookEventHandler:

Public Types

enum  SendCode {
  SUCCESS , UNKNOWN , TIMEOUT , INVALID_ACCOUNT_FOR_MARKET ,
  INVALID_INSTRUMENT , NETWORK_FAILURE , SDK_NOT_INITIALIZED , ALREADY_IN_MARKET ,
  CHANGE_AFTER_CANCEL , ORDER_NOT_WORKING , PRICE_SUBSCRIPTION_REQUIRED , ORDER_MISSING_REQUIRED_DATA ,
  MALFORMED , ORDERBOOK_NOT_SYNCHRONIZED , RISK_NOT_READY , PRICE_SUBSCRIPTION_NOT_READY ,
  SYNTHETIC_ROUTING_NOT_AVAILABLE , ORDER_MISSING_MARKET_DATA , INVALID_ACCOUNT_ID , RESTRICTED_ACCOUNT ,
  EXCEEDED_PREALLOCATED_RISK , ORDER_THROTTLE_EXCEEDED , CHANGE_ACCOUNT_ID_NOT_ALLOWED , EXCEEDED_PREALLOCATED_RISK_CLIP_SIZE ,
  INVALID_CLIP_SIZE , CANCEL_INFLIGHT , INVALID_ACCOUNT_ID_FOR_LEG , RESTRICTED_ACCOUNT_ID_FOR_LEG
}

Public Member Functions

virtual ~IOrderBookEventHandler () noexcept=default
virtual void OnPositionUpdate (const Position &updatedPosition)
 Callback delivering position updates.
virtual void OnAccountDownloadEnd (const uint64_t accountId)
 Indicates the given account have been synchronized with the realtime streams, orders and positions have been downloaded.
virtual void OnAccountDownloadFailed (const uint64_t accountId, const char *message)
 Indicates the given account orders and positions downloads have failed and the account if not usable. This is a critical failure.
virtual void OnOrderBookDownloadEnd ()
 Indicates all orders and positions for all accounts are downloaded and synchronized with the realtime stream.
virtual void OnRiskReserved (const uint64_t instrumentId, const uint64_t accountId, const RiskSide side, const bool successful)
 Callback for a reserve risk request. Orders sent before a PR is acked will be rejected.
virtual void OnRiskReleased (const uint64_t instrumentId, const uint64_t accountId, const RiskSide side, const bool successful)
 Callback for a release reserve risk request.
virtual void OnExecutionReport (OrderPtr order, ExecutionReportPtr execRpt)=0
 Callback delivering execution report messages.
virtual void OnEpiqUpdate (OrderPtr order, double epiq)
virtual void OnExportValuesUpdate (OrderPtr order, const ttsdk::ExportValues &exports)
virtual void OnReject (OrderPtr order, RejectResponsePtr rejResp)=0
 Callback delivering order reject messages.
virtual void OnSendFailed (OrderPtr order, const OrderProfile &profile, const SendCode code)=0
 Callback fired when a request delivery surpasses the timeout threshold.
virtual void OnUnsubscribed (const char *orderId)=0
 Callback fired when the unsubscribe request is complete and it is safe to.

Detailed Description

Interface for listening to order and position events. There is one OrderBookEventHandler set in the SDK. All order events will go to this handler unless a specific handler is set for specific orders on an order by order basis.

Warning
It is assumed this object will exist for the life of the SDK.

Definition at line 245 of file order.h.

Member Enumeration Documentation

◆ SendCode

Enumerator
SUCCESS 
UNKNOWN 
TIMEOUT 
INVALID_ACCOUNT_FOR_MARKET 
INVALID_INSTRUMENT 
NETWORK_FAILURE 
SDK_NOT_INITIALIZED 
ALREADY_IN_MARKET 
CHANGE_AFTER_CANCEL 
ORDER_NOT_WORKING 
PRICE_SUBSCRIPTION_REQUIRED 
ORDER_MISSING_REQUIRED_DATA 
MALFORMED 
ORDERBOOK_NOT_SYNCHRONIZED 
RISK_NOT_READY 
PRICE_SUBSCRIPTION_NOT_READY 
SYNTHETIC_ROUTING_NOT_AVAILABLE 
ORDER_MISSING_MARKET_DATA 
INVALID_ACCOUNT_ID 
RESTRICTED_ACCOUNT 
EXCEEDED_PREALLOCATED_RISK 
ORDER_THROTTLE_EXCEEDED 
CHANGE_ACCOUNT_ID_NOT_ALLOWED 
EXCEEDED_PREALLOCATED_RISK_CLIP_SIZE 
INVALID_CLIP_SIZE 
CANCEL_INFLIGHT 
INVALID_ACCOUNT_ID_FOR_LEG 
RESTRICTED_ACCOUNT_ID_FOR_LEG 

Definition at line 138 of file order.h.

Constructor & Destructor Documentation

◆ ~IOrderBookEventHandler()

virtual ttsdk::IOrderBookEventHandler::~IOrderBookEventHandler ( )
virtualdefaultnoexcept

Member Function Documentation

◆ OnAccountDownloadEnd()

virtual void ttsdk::IOrderBookEventHandler::OnAccountDownloadEnd ( const uint64_t accountId)
inlinevirtual

Indicates the given account have been synchronized with the realtime streams, orders and positions have been downloaded.

Definition at line 255 of file order.h.

◆ OnAccountDownloadFailed()

virtual void ttsdk::IOrderBookEventHandler::OnAccountDownloadFailed ( const uint64_t accountId,
const char * message )
inlinevirtual

Indicates the given account orders and positions downloads have failed and the account if not usable. This is a critical failure.

Definition at line 260 of file order.h.

◆ OnEpiqUpdate()

virtual void ttsdk::IOrderEventHandler::OnEpiqUpdate ( OrderPtr order,
double epiq )
inlinevirtualinherited

Definition at line 175 of file order.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnExecutionReport()

virtual void ttsdk::IOrderEventHandler::OnExecutionReport ( OrderPtr order,
ExecutionReportPtr execRpt )
pure virtualinherited

Callback delivering execution report messages.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnExportValuesUpdate()

virtual void ttsdk::IOrderEventHandler::OnExportValuesUpdate ( OrderPtr order,
const ttsdk::ExportValues & exports )
inlinevirtualinherited

Definition at line 177 of file order.h.

◆ OnOrderBookDownloadEnd()

virtual void ttsdk::IOrderBookEventHandler::OnOrderBookDownloadEnd ( )
inlinevirtual

Indicates all orders and positions for all accounts are downloaded and synchronized with the realtime stream.

Definition at line 264 of file order.h.

◆ OnPositionUpdate()

virtual void ttsdk::IOrderBookEventHandler::OnPositionUpdate ( const Position & updatedPosition)
inlinevirtual

Callback delivering position updates.

Definition at line 251 of file order.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnReject()

virtual void ttsdk::IOrderEventHandler::OnReject ( OrderPtr order,
RejectResponsePtr rejResp )
pure virtualinherited

Callback delivering order reject messages.

◆ OnRiskReleased()

virtual void ttsdk::IOrderBookEventHandler::OnRiskReleased ( const uint64_t instrumentId,
const uint64_t accountId,
const RiskSide side,
const bool successful )
inlinevirtual

Callback for a release reserve risk request.

Definition at line 271 of file order.h.

◆ OnRiskReserved()

virtual void ttsdk::IOrderBookEventHandler::OnRiskReserved ( const uint64_t instrumentId,
const uint64_t accountId,
const RiskSide side,
const bool successful )
inlinevirtual

Callback for a reserve risk request. Orders sent before a PR is acked will be rejected.

Definition at line 268 of file order.h.

◆ OnSendFailed()

virtual void ttsdk::IOrderEventHandler::OnSendFailed ( OrderPtr order,
const OrderProfile & profile,
const SendCode code )
pure virtualinherited

Callback fired when a request delivery surpasses the timeout threshold.

◆ OnUnsubscribed()

virtual void ttsdk::IOrderEventHandler::OnUnsubscribed ( const char * orderId)
pure virtualinherited

Callback fired when the unsubscribe request is complete and it is safe to.


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