Пример #1
0
        private void UpdateStrategyAdjustment(ContractKeyVM contract, StrategyVM.Model model, double adjust)
        {
            var strategy = _otcOptionHandler.StrategyVMCollection.FirstOrDefault(s => s.Equals(contract));

            if (strategy != null)
            {
                PricingContractParamVM pricingContract = null;
                switch (model)
                {
                case StrategyVM.Model.PM:
                    pricingContract = strategy.PricingContractParams.FirstOrDefault();
                    break;

                case StrategyVM.Model.IVM:
                    pricingContract = strategy.IVMContractParams.FirstOrDefault();
                    break;

                case StrategyVM.Model.VM:
                    pricingContract = strategy.VMContractParams.FirstOrDefault();
                    break;
                }

                if (pricingContract != null)
                {
                    pricingContract.Adjust = adjust;
                    _otcOptionHandler.UpdateStrategyPricingContracts(strategy, model);
                }
            }
        }
Пример #2
0
        public void UpdateStrategyModel(StrategyVM sVM, StrategyVM.Model model)
        {
            var strategy = new PBStrategy();

            strategy.Exchange     = sVM.Exchange;
            strategy.Contract     = sVM.Contract;
            strategy.Symbol       = sVM.StrategySym;
            strategy.BaseContract = sVM.BaseContract;

            if (model == StrategyVM.Model.PM)
            {
                strategy.PricingModel = sVM.PricingModel;
            }

            if (model == StrategyVM.Model.IVM)
            {
                strategy.IvModel = sVM.IVModel;
            }

            if (model == StrategyVM.Model.VM)
            {
                strategy.VolModel = sVM.VolModel;
            }

            MessageWrapper.SendMessage((uint)BusinessMessageID.MSG_ID_MODIFY_PRICING_CONTRACT, strategy);
        }
Пример #3
0
        public void UpdateStrategyPricingContracts(StrategyVM sVM, StrategyVM.Model model)
        {
            var strategy = new PBStrategy();

            strategy.Exchange = sVM.Exchange;
            strategy.Contract = sVM.Contract;
            strategy.Symbol   = sVM.StrategySym;

            if (model == StrategyVM.Model.PM)
            {
                foreach (var pc in sVM.PricingContractParams)
                {
                    strategy.PricingContracts.Add(new PBPricingContract()
                    {
                        Exchange = pc.Exchange, Contract = pc.Contract, Adjust = pc.Adjust, Weight = pc.Weight
                    });
                }
            }

            if (model == StrategyVM.Model.IVM)
            {
                foreach (var pc in sVM.IVMContractParams)
                {
                    strategy.IvmContracts.Add(new PBPricingContract()
                    {
                        Exchange = pc.Exchange, Contract = pc.Contract, Adjust = pc.Adjust, Weight = pc.Weight
                    });
                }
            }

            if (model == StrategyVM.Model.VM)
            {
                foreach (var pc in sVM.VMContractParams)
                {
                    strategy.VolContracts.Add(new PBPricingContract()
                    {
                        Exchange = pc.Exchange, Contract = pc.Contract, Adjust = pc.Adjust, Weight = pc.Weight
                    });
                }
            }

            MessageWrapper.SendMessage((uint)BusinessMessageID.MSG_ID_MODIFY_PRICING_CONTRACT, strategy);
        }