I am trying to create a bot that sends screenshots to Telegram every time I place an order manually (OrderState == Filled).
However, I have tried to do it with the method OnExecutionUpdate() but seems like, even If I place an order, the code does nothing:
protected override void OnExecutionUpdate(Execution execution, string executionId, double price, int quantity, MarketPosition marketPosition, string orderId, DateTime time)
{
// Remember to check the underlying Order object for null before trying to access its properties
Print(execution.Order.OrderState.ToString());
if (execution.Order != null && execution.Order.OrderState == OrderState.Filled)
Print(execution.Order.OrderState.ToString());
sendCombiMessage();
}
Even If I try to print the OrderStatus, it doesn´t work as much as I place orders.
SendCombiMessage() is the function to send screenshots to Telegram.
Is there anything I'm doing wrong? Do I need something more so the function triggers when I place orders manually?
Thanks in advance
Comment