TT CORE SDK 2.0.1.1
TT CORE SDK documentation
Loading...
Searching...
No Matches
ttsdk::SDKAlgo Class Referenceabstract

an interface to interact with the sdk managed algo. More...

#include <sdkalgo.h>

Inheritance diagram for ttsdk::SDKAlgo:
Collaboration diagram for ttsdk::SDKAlgo:

Public Member Functions

 SDKAlgo ()
 
 ~SDKAlgo ()
 
virtual const charGetOrderId () const noexcept=0
 Returns the unique id of this algo.
 
virtual InstrumentPtr GetInstrument () const noexcept=0
 Returns the instrument referenced by the algo. Might be null if the user did not send.
 
virtual AlgoDefinitionPtr GetAlgoDefinition () const noexcept=0
 Returns the algo definition Id for the algo definition.
 
virtual ExecutionReportPtr GetCurrentState () const noexcept=0
 Returns the current state of the algo.
 
virtual bool GenerateSyntheticFill (const double fillPrc, const double fillQty) noexcept=0
 Generates and sends a fill message for the given qty and price. If the fill qty exceeds the currently.
 
virtual bool GenerateUserResponse (const char *msg, const ttsdk::UserParameter params[], const size_t numParams) noexcept=0
 Generates and sends a restatement message to the user contains the given information. Note that.
 
virtual bool FailAlgo (const char *message) noexcept=0
 Sets this algo as failed and send a message to user indicating failed status. This will not remove the order from the order book but will indicate to the end user the algo has stopped working and they need to cancel it.
 
virtual bool StopAlgo (const char *message) noexcept=0
 Sets this algo as finished and send a message to user indicating finished status.
 
virtual void OnPendingRequestCompleted (const AlgoResponseCode code, const char *message=nullptr) noexcept=0
 This needs to be called when a request from the user is completed. If the algo request action was successful, pass AlgoResponseCode::ok otherwise pass in a code that describes the reason for failure.
 
virtual void ScheduledEvent (unsigned int eventId, void *eventUserData)=0
 Schedules an OnScheduleEvent callback to be triggered for this algo with the given id and user data.
 
virtual bool ReserveRisk (InstrumentPtr instrument, const uint64_t accountId, const RiskSide side, const double quantity, const double maxClipSize) noexcept=0
 Reserves a quantity of risk for the given instrumentId/accountId/side to be used to by this algo to avoid the quantity checks in bouncer when an order is sent. Must be called before the algo places any orders on that instrument/account/side. If orders already exists for the instrument/account/side or there already is risk allocated for it, this method will return false. maxClipSize indicates the max lot size for orders sent. This value can not exceed any max order qty values defined in TT Setup.
 
virtual bool ReleaseRisk (InstrumentPtr instrument, const uint64_t accountId, const RiskSide side) noexcept=0
 Releases the previously allocated quantity of risk for the given instrumentId/accountId/side.
 
virtual PositionReserveBucket GetRiskBucket (InstrumentPtr instrument, const uint64_t accountId) noexcept=0
 Returns the current position reserve bucket for the instrument and account.
 
- Public Member Functions inherited from ttsdk::shared_base
 shared_base ()
 
virtual ~shared_base ()
 
int dec_ref () const
 
void inc_ref () const
 
virtual void del_ref () const
 

Detailed Description

an interface to interact with the sdk managed algo.

Definition at line 114 of file sdkalgo.h.

Constructor & Destructor Documentation

◆ SDKAlgo()

ttsdk::SDKAlgo::SDKAlgo ( )
inlineexplicit

Definition at line 117 of file sdkalgo.h.

◆ ~SDKAlgo()

ttsdk::SDKAlgo::~SDKAlgo ( )
inline

Definition at line 118 of file sdkalgo.h.

Member Function Documentation

◆ FailAlgo()

virtual bool ttsdk::SDKAlgo::FailAlgo ( const char * message)
pure virtualnoexcept

Sets this algo as failed and send a message to user indicating failed status. This will not remove the order from the order book but will indicate to the end user the algo has stopped working and they need to cancel it.

◆ GenerateSyntheticFill()

virtual bool ttsdk::SDKAlgo::GenerateSyntheticFill ( const double fillPrc,
const double fillQty )
pure virtualnoexcept

Generates and sends a fill message for the given qty and price. If the fill qty exceeds the currently.

◆ GenerateUserResponse()

virtual bool ttsdk::SDKAlgo::GenerateUserResponse ( const char * msg,
const ttsdk::UserParameter params[],
const size_t numParams )
pure virtualnoexcept

Generates and sends a restatement message to the user contains the given information. Note that.

◆ GetAlgoDefinition()

virtual AlgoDefinitionPtr ttsdk::SDKAlgo::GetAlgoDefinition ( ) const
pure virtualnoexcept

Returns the algo definition Id for the algo definition.

◆ GetCurrentState()

virtual ExecutionReportPtr ttsdk::SDKAlgo::GetCurrentState ( ) const
pure virtualnoexcept

Returns the current state of the algo.

◆ GetInstrument()

virtual InstrumentPtr ttsdk::SDKAlgo::GetInstrument ( ) const
pure virtualnoexcept

Returns the instrument referenced by the algo. Might be null if the user did not send.

◆ GetOrderId()

virtual const char * ttsdk::SDKAlgo::GetOrderId ( ) const
pure virtualnoexcept

Returns the unique id of this algo.

◆ GetRiskBucket()

virtual PositionReserveBucket ttsdk::SDKAlgo::GetRiskBucket ( InstrumentPtr instrument,
const uint64_t accountId )
pure virtualnoexcept

Returns the current position reserve bucket for the instrument and account.

◆ OnPendingRequestCompleted()

virtual void ttsdk::SDKAlgo::OnPendingRequestCompleted ( const AlgoResponseCode code,
const char * message = nullptr )
pure virtualnoexcept

This needs to be called when a request from the user is completed. If the algo request action was successful, pass AlgoResponseCode::ok otherwise pass in a code that describes the reason for failure.

◆ ReleaseRisk()

virtual bool ttsdk::SDKAlgo::ReleaseRisk ( InstrumentPtr instrument,
const uint64_t accountId,
const RiskSide side )
pure virtualnoexcept

Releases the previously allocated quantity of risk for the given instrumentId/accountId/side.

◆ ReserveRisk()

virtual bool ttsdk::SDKAlgo::ReserveRisk ( InstrumentPtr instrument,
const uint64_t accountId,
const RiskSide side,
const double quantity,
const double maxClipSize )
pure virtualnoexcept

Reserves a quantity of risk for the given instrumentId/accountId/side to be used to by this algo to avoid the quantity checks in bouncer when an order is sent. Must be called before the algo places any orders on that instrument/account/side. If orders already exists for the instrument/account/side or there already is risk allocated for it, this method will return false. maxClipSize indicates the max lot size for orders sent. This value can not exceed any max order qty values defined in TT Setup.

◆ ScheduledEvent()

virtual void ttsdk::SDKAlgo::ScheduledEvent ( unsigned int eventId,
void * eventUserData )
pure virtual

Schedules an OnScheduleEvent callback to be triggered for this algo with the given id and user data.

◆ StopAlgo()

virtual bool ttsdk::SDKAlgo::StopAlgo ( const char * message)
pure virtualnoexcept

Sets this algo as finished and send a message to user indicating finished status.


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