Click or drag to resize

Stop orders

The same RegisterOrder method used to register stop orders, but with the Conditional type of order indicating:

C#
private void NewStopOrderClick(object sender, RoutedEventArgs e)
{
    var newOrder = new OrderConditionalWindow
    {
        Order = new Order
        {
            Security = SecurityPicker.SelectedSecurity,
            Type = OrderTypes.Conditional,
        },
        SecurityProvider = Connector,
        MarketDataProvider = Connector,
        Portfolios = new PortfolioDataSource(Connector),
        Adapter = Connector.TransactionAdapter
    };

    if (newOrder.ShowModal(this))
        Connector.RegisterOrder(newOrder.Order);
}

Next, the Conditional Order Register dialogue opened where you need to specify the type and parameters of such order.

Behind the scenes the conditions are created and configured in the OrderConditionalWindow code using the CQGOrderCondition class.