The trading strategy is executed through onMarketData
when the downloading of data is completed/successful (it sends a message to the agent). If any error occurs, notify the agent. Everything is logged to a SQL backend (SQL Server).
The trading strategy will have six callable functions:
onInit
: This function is called when a strategy is initializedonStart
: This function is called when the strategy startsonStop
: This function is called when the strategy stopsonMarketData
: This function is called whenever new market data arrivesonTradeExecution
: This function is called whenever a trade is executedonError
: This function is called with every error that occurs
The trading strategy will be implemented as a type of its own where callbacks are member functions that are called from the strategy executor. The strategy executor consists of an agent receiving messages from the system. The start and stop commands are sent from the two event handlers...