private void OnOrderUpdate()
if (Position.MarketPosition == MarketPosition.Flat)
{
CancelOrders();
}
private void CancelOrders()
{
foreach (var order in Orders)
{
if (order.OrderState == OrderState.Working)
{
CancelOrder(order);
}
}
}
Is there a way to get this to work or is there another way I can get it to cancel all pending orders once position is flat?
Thanks
Comment