I'm trying to build a messenger notification for all my strategies. The goal is that I get a notification, when a strategy executes an trade.
For the first step, I tried to write this programm as own strategy, which receive following events :
protected override void OnAccountItemUpdate(Cbi.Account account, Cbi.AccountItem accountItem, double value)
{
SendMessage("OnAccountItemUpdate");
}
protected override void OnConnectionStatusUpdate(ConnectionStatusEventArgs connectionStatusUpdate)
{
SendMessage("OnConnectionStatusUpdate");
}
protected override void OnExecutionUpdate(Cbi.Execution execution, string executionId, double price, int quantity,
Cbi.MarketPosition marketPosition, string orderId, DateTime time)
{
SendMessage("OnExecutionUpdate");
SendMessage("Executed " + ((marketPosition == Cbi.MarketPosition.Short) ? "Short" : "Long") + " price : " + price + " Anzahl : " + quantity);
SendMessage("ExecutionStringMethod : " + execution.ToString());
}
protected override void OnOrderUpdate(Cbi.Order order, double limitPrice, double stopPrice,
int quantity, int filled, double averageFillPrice,
Cbi.OrderState orderState, DateTime time, Cbi.ErrorCode error, string comment)
{
SendMessage("OnOrderUpdate");
}
protected override void OnPositionUpdate(Cbi.Position position, double averagePrice,
int quantity, Cbi.MarketPosition marketPosition)
{
SendMessage("OnPositionUpdate");
}
My focus is the "OnExecutionUpdate" Event, but this event isn't triggerd when my strategy executes an order. I only receive the "OnAccountItemUpdate" Event.
Because that I have three questions:
1. What is the correct Event for notification for a new Order on the markt ?
2. The best way for implementation is the addon or ? This feature shouldn't be a strategy ?
2.1 Is it possible to enable/disable addons and check which addons are running?
Thank your for your help

Comment