Click or drag to resize

Order log

OrderLogGrid is a graphical component to display the order log ( OrderLogItem).

Main properties and methods

Below is the appearance of the component, as well as code snippets with its use. The code example is taken from Samples/ITCH/SampleITCH.

GUI orderlog
XAML
Window x:Class="SampleITCH.OrdersLogWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:loc="clr-namespace:StockSharp.Localization;assembly=StockSharp.Localization"
        xmlns:xaml="http://schemas.stocksharp.com/xaml"
        Title="{x:Static loc:LocalizedStrings.OrderLog}" Height="750" Width="900">
  <xaml:OrderLogGrid x:Name="OrderLogGrid" x:FieldModifier="public" />
</Window>
C#
private void ConnectClick(object sender, RoutedEventArgs e)
{
    if (!_isConnected)
    {
        if (!_initialized)
        {
            _initialized = true;

            // subscribe on connection successfully event
            Trader.Connected += () =>
            {
                // set flag (connection is established)
                _isConnected = true;

                // update gui labes
                this.GuiAsync(() => ChangeConnectStatus(true));
            };

            .................................................


            Trader.NewOrderLogItems += _orderLogWindow.OrderLogGrid.LogItems.AddRange;

            .................................................

            ShowSecurities.IsEnabled = ShowTrades.IsEnabled = ShowOrdersLog.IsEnabled = true;
        }

        Trader.Connect();
    }
    else
    {
        Trader.Disconnect();
    }
}