144 virtual
bool FailAlgo(const
char* message) noexcept = 0;
146 virtual
bool StopAlgo(const
char* message) noexcept = 0;
165 const
double quantity, const
double maxClipSize) noexcept = 0;
Interface for listening to sdk algo events.
virtual void OnStopRequest(SDKAlgoPtr algoOrder, SDKAlgoRequestPtr req)=0
Callback to stop an existiong algo instance.
virtual bool RecoverSDKAlgos() const
Returns whether or not the SDK algos created in prior instance of the application should be recovered...
virtual void OnAlgoCompleted(SDKAlgoPtr algoOrder)=0
Callback when an algo is finished and should no longer be used. This will be called.
virtual void OnRiskReleased(SDKAlgoPtr algoOrder, const uint64_t instrumentId, const uint64_t accountId, const ttsdk::RiskSide side, const AlgoResponseCode code)
Callback for a release reserve risk request.
virtual void OnScheduledEvent(SDKAlgoPtr algoOrder, unsigned int eventId, void *eventUserData)=0
Callback for an event scheduled by the user.An event is scheduled programmatically.
virtual void OnStartRequest(SDKAlgoPtr algoOrder, SDKAlgoRequestPtr req)=0
Callback to start a new algo instance.
virtual void OnRecoverAlgo(SDKAlgoPtr algoOrder, SDKAlgoRequestPtr req)=0
Callback when a working algo is downloaded on startup and need to be recovered.
virtual void OnPauseRequest(SDKAlgoPtr algoOrder, SDKAlgoRequestPtr req)=0
Callback when a request to pause an algo is received. When an algo is in paused state,...
virtual void OnResumeRequest(SDKAlgoPtr algoOrder, SDKAlgoRequestPtr req)=0
Callback when a request to restart a paused algo is received.
virtual void OnRecoveryEnd()=0
Callback when all algos have been downloaded and OnRecoverAlgo called for each of them.
virtual void OnRecoveryFailed()=0
Callback when the previous algos can not be downloaded and recovered.
virtual const char * GetMarkets()=0
Returns the preferred markets for this instance in a comma separated list of market ids....
virtual void OnRiskReserved(SDKAlgoPtr algoOrder, const uint64_t instrumentId, const uint64_t accountId, const ttsdk::RiskSide side, const AlgoResponseCode code)
Callback for a reserve risk request. Orders sent before a PR is acked will be rejected.
virtual ~ISDKAlgoManager() noexcept=default
virtual void OnUpdateRequest(SDKAlgoPtr algoOrder, SDKAlgoRequestPtr req)=0
Callback when an update request is made for an existing algo.
an interface to interact with the sdk managed algo.
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....
virtual ExecutionReportPtr GetCurrentState() const noexcept=0
Returns the current state of the algo.
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 a...
virtual AlgoDefinitionPtr GetAlgoDefinition() const noexcept=0
Returns the algo definition Id for the algo definition.
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 const char * GetOrderId() const noexcept=0
Returns the unique id of this algo.
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 th...
virtual bool StopAlgo(const char *message) noexcept=0
Sets this algo as finished and send a message to user indicating finished status.
virtual PositionReserveBucket GetRiskBucket(InstrumentPtr instrument, const uint64_t accountId) noexcept=0
Returns the current position reserve bucket for the instrument and account.
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 suc...
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 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 InstrumentPtr GetInstrument() const noexcept=0
Returns the instrument referenced by the algo. Might be null if the user did not send.