예제 #1
0
        public MainWindow()
        {
            InitializeComponent();

            Title = Title.Put("FIX");

            _ordersWindow.MakeHideable();
            _myTradesWindow.MakeHideable();
            _tradesWindow.MakeHideable();
            _securitiesWindow.MakeHideable();
            _stopOrdersWindow.MakeHideable();
            _portfoliosWindow.MakeHideable();
            _newsWindow.MakeHideable();

            if (File.Exists(_settingsFile))
            {
                Trader.Load(new XmlSerializer <SettingsStorage>().Deserialize(_settingsFile));
            }

            MarketDataSessionSettings.SelectedObject  = Trader.MarketDataAdapter;
            TransactionSessionSettings.SelectedObject = Trader.TransactionAdapter;

            MarketDataSupportedMessages.Adapter  = Trader.MarketDataAdapter;
            TransactionSupportedMessages.Adapter = Trader.TransactionAdapter;

            Instance = this;

            Trader.LogLevel = LogLevels.Debug;

            _logManager.Sources.Add(Trader);
            _logManager.Listeners.Add(new FileLogListener {
                LogDirectory = "StockSharp_Fix"
            });
        }
예제 #2
0
        public MainWindow()
        {
            InitializeComponent();

            Title = Title.Put("FIX");

            _ordersWindow.MakeHideable();
            _myTradesWindow.MakeHideable();
            _tradesWindow.MakeHideable();
            _securitiesWindow.MakeHideable();
            _stopOrdersWindow.MakeHideable();
            _portfoliosWindow.MakeHideable();
            _ordersLogWindow.MakeHideable();
            _newsWindow.MakeHideable();

            if (File.Exists(_settingsFile))
            {
                var ctx = new ContinueOnExceptionContext();
                ctx.Error += ex => ex.LogError();

                using (new Scope <ContinueOnExceptionContext>(ctx))
                    Trader.Load(new XmlSerializer <SettingsStorage>().Deserialize(_settingsFile));
            }

            MarketDataSessionSettings.SelectedObject  = Trader.MarketDataAdapter;
            TransactionSessionSettings.SelectedObject = Trader.TransactionAdapter;

            MarketDataSupportedMessages.Adapter  = Trader.MarketDataAdapter;
            TransactionSupportedMessages.Adapter = Trader.TransactionAdapter;

            Instance = this;

            _logManager.Sources.Add(Trader);
            _logManager.Listeners.Add(new FileLogListener {
                LogDirectory = "StockSharp_Fix"
            });
            _logManager.Listeners.Add(new GuiLogListener(LogControl));
        }