Orders mass cancel
To cancel several orders the Connector.CancelOrders(System.Nullable<System.Boolean> isStopOrder, StockSharp.BusinessEntities.Portfolio portfolio, System.Nullable<StockSharp.Messages.Sides> direction, StockSharp.BusinessEntities.ExchangeBoard board, StockSharp.BusinessEntities.Security security, System.Nullable<StockSharp.Messages.SecurityTypes> securityType, System.Nullable<System.Int64> transactionId ) method used, which cancel the active orders by the parameters mask passed.
Orders mass cancel examples
To cancel all ordinary orders (OrderTypes.Limit) for the specified portfolio and instrument:
_connector.CancelOrders(false, MainWindow.Instance.Portfolio, null, null, security);
To cancel all orders for the specified instrument:
_connector.CancelOrders(null, null, null, null, security);
To cancel all long stop orders:
_connector.CancelOrders(true, null, Sides.Buy, null, null);