Click or drag to resize

New stop order creation

OrderConditionalWindow - the window for creating a conditional order.

GUI OrderConditionalWindow

Main properties

Below is the code snippet with its use. The code example is taken from Samples/InteractiveBrokers/SampleIB.

C#
...

private readonly Connector _connector = new Connector();

...
private void NewStopOrderClick(object sender, RoutedEventArgs e)
{
    var newOrder = new OrderConditionalWindow
    {
        Order = new Order
        {
            Security = SecurityPicker.SelectedSecurity,
            Type = OrderTypes.Conditional,
            ExpiryDate = DateTime.Today
        },
        SecurityProvider = _connector,
        MarketDataProvider = _connector,
        Portfolios = new PortfolioDataSource(_connector),
        Adapter = _connector.Adapter
    };

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