Esempio n. 1
0
        private async void LoadContract()
        {
            if (FastOrderContract.SelectedItem == null)
            {
                FastOrderContract.SelectedItem = FastOrderContract.Filter ?? string.Empty;
            }

            var contract = FastOrderContract.SelectedItem.ToString();

            if (FuturecontractList.Any(c => c.Contract == contract))
            {
                OrderVM.Contract = contract;
                var quote = OrderVM.Contract;
                var item  = await MessageHandlerContainer.DefaultInstance.Get <MarketDataHandler>().SubMarketDataAsync(quote);

                if (item != null)
                {
                    stackPanelPrices.DataContext = item;
                    var contractInfo = ClientDbContext.FindContract(quote);
                    LimitTxt.Increment       = contractInfo == null ? 1 : contractInfo.PriceTick;
                    checkBox.IsEnabled       = true;
                    radioButtonBuy.IsChecked = true;
                    //radioButtonSell.IsChecked = false;
                    RadioA.IsChecked = true;
                    //RadioB.IsChecked = false;
                    //RadioC.IsChecked = false;
                    LimitTxt.SetBinding(DoubleUpDown.ValueProperty, new Binding("AskPrice.Value")
                    {
                        Mode = BindingMode.OneWay
                    });
                }
            }
            else
            {
                checkBox.IsChecked = false;
                checkBox.IsEnabled = false;
            }
        }
Esempio n. 2
0
 private void Initialize()
 {
     portofolioCB.ItemsSource   = MessageHandlerContainer.DefaultInstance.Get <AbstractOTCHandler>()?.PortfolioVMCollection;
     FastOrderContract.Provider = new SuggestionProvider((string c) => { return(FuturecontractList.Where(ci => ci.Contract.StartsWith(c, true, null)).Select(cn => cn.Contract)); });
     TradeHandler = MessageHandlerContainer.DefaultInstance.Get <OTCOptionTradeHandler>();
 }