Ejemplo n.º 1
0
        private void exCheckBox_UnChecked(object sender, RoutedEventArgs e)
        {
            Control ctrl = sender as Control;

            if (ctrl != null)
            {
                StrategyBaseVM strategyBaseVM = ctrl.DataContext as StrategyBaseVM;
                var            basecontract   = strategyBaseVM.Contract;
                _riskSet.Remove(basecontract);
                if (marketRadioButton.IsChecked.Value)
                {
                    string msg = string.Format("{0}", basecontract);
                    //selectedWrapPanel.Children.Contains(UIElement.);
                }
                else if (settlementRadioButton.IsChecked.Value)
                {
                    //SelectedContractVMCollection.Remove(new SelectedContractVM { Contract = basecontract, Price = strategyBaseVM.MktVM.PreSettlePrice });
                }
                else if (valuationRadioButton.IsChecked.Value)
                {
                    //SelectedContractVMCollection.Remove(new SelectedContractVM { Contract = basecontract, Price = strategyBaseVM.Valuation });
                }
                var strategyVMCollection = _otcOptionHandler?.StrategyVMCollection;
                var strategyVMList       = strategyVMCollection.Where(s => s.BaseContract == basecontract);
                foreach (var vm in strategyVMList)
                {
                    var contractinfo = ClientDbContext.FindContract(vm.Contract);
                    if (contractinfo.ExpireDate == strategyBaseVM.Expiration)
                    {
                        _riskSet.Remove(vm.Contract);
                    }
                }
                ReloadDataCallback();
            }
        }
Ejemplo n.º 2
0
        private void OnKeyDown(object sender, KeyEventArgs e)
        {
            Control ctrl = sender as Control;

            if (ctrl != null)
            {
                if (e.Key == Key.Enter)
                {
                    StrategyBaseVM strategyBaseVM = ctrl.DataContext as StrategyBaseVM;

                    if (strategyBaseVM != null)
                    {
                        ReloadDataCallback();
                    }
                }
            }
        }
Ejemplo n.º 3
0
        private void exCheckBox_UnChecked(object sender, RoutedEventArgs e)
        {
            Control ctrl = sender as Control;

            if (ctrl != null)
            {
                StrategyBaseVM strategyBaseVM       = ctrl.DataContext as StrategyBaseVM;
                var            strategyVMCollection = _otcOptionHandler?.StrategyVMCollection;
                var            strategyVMList       = strategyVMCollection.Where(s => s.BaseContract == strategyBaseVM.Contract);
                foreach (var vm in strategyVMList)
                {
                    if (vm.BaseContract != null)
                    {
                        _riskSet.Remove(vm.BaseContract);
                    }
                }
            }
        }
Ejemplo n.º 4
0
        private void exCheckBox_UnChecked(object sender, RoutedEventArgs e)
        {
            Control ctrl = sender as Control;

            if (ctrl != null)
            {
                StrategyBaseVM strategyBaseVM       = ctrl.DataContext as StrategyBaseVM;
                var            strategyVMCollection = _otcOptionHandler?.StrategyVMCollection;
                var            strategyVMList       = strategyVMCollection.Where(s => s.BaseContract == strategyBaseVM.Contract);
                foreach (var vm in strategyVMList)
                {
                    var contractinfo = ClientDbContext.FindContract(vm.Contract);
                    if (contractinfo.ExpireDate == strategyBaseVM.Expiration)
                    {
                        _riskSet.Remove(vm.Contract);
                    }
                }
                ReloadDataCallback();
            }
        }
Ejemplo n.º 5
0
        private async void exCheckBox_Checked(object sender, RoutedEventArgs e)
        {
            Control ctrl = sender as Control;

            if (ctrl != null)
            {
                StrategyBaseVM strategyBaseVM = ctrl.DataContext as StrategyBaseVM;
                var            basecontract   = strategyBaseVM.Contract;
                _riskSet.Add(basecontract);
                //if (marketRadioButton.IsChecked.Value)
                //{
                //    string msg = string.Format("  {0}: {1:N2}", basecontract, (strategyBaseVM.MktVM.AskPrice + strategyBaseVM.MktVM.BidPrice) / 2);
                //    selectedWrapPanel.Children.Add(new Label { Content = msg });
                //}
                //else if (settlementRadioButton.IsChecked.Value)
                //{
                //    string msg = string.Format("  {0}: {1:N2}", basecontract, strategyBaseVM.MktVM.PreSettlePrice);
                //    selectedWrapPanel.Children.Add(new Label { Content = msg });
                //}
                //else if (valuationRadioButton.IsChecked.Value)
                //{
                //    string msg = string.Format("  {0}: {1:N2}", basecontract, strategyBaseVM.Valuation);
                //    selectedWrapPanel.Children.Add(new Label { Content = msg });
                //}
                MarketData = await _marketdataHandler.SubMarketDataAsync(basecontract);

                var strategyVMCollection = _otcOptionHandler?.StrategyVMCollection;
                var strategyVMList       = strategyVMCollection.Where(s => s.BaseContract == strategyBaseVM.Contract);
                foreach (var vm in strategyVMList)
                {
                    var contractinfo = ClientDbContext.FindContract(vm.Contract);
                    if (contractinfo.ExpireDate == strategyBaseVM.Expiration)
                    {
                        _riskSet.Add(vm.Contract);
                    }
                }
                ReloadDataCallback();
            }
        }