public FuturesTickViewModel(FuturesViewModel futuresViewModel)
 {
     _futuresViewModel = futuresViewModel;
     //for (int i = 0; i < 10; i++)
     //{
     //    _EachDealList.Add(new EachDealViewModel(this));
     //}
 }
예제 #2
0
        public ContractDetailInfoViewModel(FuturesViewModel futuresViewModel)
        {
            var variModel = TradeInfoHelper.VarietyModelList.FirstOrDefault(o => string.Equals(o.productCode, futuresViewModel.ProductCode));

            if (variModel != null)
            {
                ProductCode    = variModel.productCode;
                ProductName    = variModel.productName;
                ExchangeName   = variModel.exchangeName;
                CurrencyName   = variModel.currencyName;
                Multiple       = variModel.multiple ?? 0;
                TickSize       = new decimal(variModel.tickSize ?? 0);
                TimeListRemark = variModel.timeListRemark;//variModel.timeList.Replace(",", "-");
                SettleTime     = variModel.settleTime;
                ChangeMonth    = variModel.changeMonth;
            }
        }
예제 #3
0
 public void SetOptionalList()
 {
     if (TradeInfoHelper.OptionalModelList.Count > 0)
     {
         List <FuturesViewModel> list = new List <FuturesViewModel>();
         int seq = 0;
         foreach (var item in TradeInfoHelper.OptionalModelList)
         {
             var datamodel = TradeInfoHelper.ContractModelList.FirstOrDefault(o => string.Equals(o.contractCode, item.contract_id));
             if (datamodel != null)
             {
                 seq++;
                 var viewModel = new FuturesViewModel(datamodel);
                 viewModel.Seq                  = seq;
                 viewModel.IsOptionalStock      = true;
                 viewModel.OptionalSerialNumber = item.serial_number;
                 QuotationEntity quotesmodel = null;
                 lock (TradeInfoHelper.SubscribedContractList)
                 {
                     quotesmodel = TradeInfoHelper.SubscribedContractList.FirstOrDefault(o => string.Equals(o.cd, item.contract_id));
                 }
                 if (quotesmodel != null)
                 {
                     scoketManager.UpdateModelInfo(viewModel, quotesmodel);
                 }
                 list.Add(viewModel);
             }
         }
         TradeQuotesViewModel.GetInstance(null).OptionalList = list;
     }
     else
     {
         TradeQuotesViewModel.GetInstance(null).OptionalList.Clear();
     }
     TradeQuotesViewModel.GetInstance(null).SetOptionalList();
 }
예제 #4
0
        public void AddOptionalData(OptionalContractModel item)
        {
            int seq       = TradeInfoHelper.OptionalModelList.Count;
            var datamodel = TradeInfoHelper.ContractModelList.FirstOrDefault(o => string.Equals(o.contractCode, item.contract_id));

            if (datamodel != null)
            {
                var viewModel = new FuturesViewModel(datamodel);
                viewModel.Seq                  = seq;
                viewModel.IsOptionalStock      = true;
                viewModel.OptionalSerialNumber = item.serial_number;
                QuotationEntity quotesmodel = null;
                lock (TradeInfoHelper.SubscribedContractList)
                {
                    quotesmodel = TradeInfoHelper.SubscribedContractList.FirstOrDefault(o => string.Equals(o.cd, item.contract_id));
                }
                if (quotesmodel != null)
                {
                    ScoketManager.GetInstance().UpdateModelInfo(viewModel, quotesmodel);
                }
                OptionalList.Add(viewModel);
                SetOptionalList();
            }
        }
 public FuturesTickViewModel(FuturesViewModel futuresViewModel)
 {
     _futuresViewModel = futuresViewModel;
 }