public override void setFromSerial(FpmlSerializedCSharp.ISerialized serial_Class)
        {
            FpmlSerializedCSharp.Excel_underlyingModel_para serial_Excel_underlyingModel_para = serial_Class as FpmlSerializedCSharp.Excel_underlyingModel_para;
            FpmlSerializedCSharp.Excel_hullWhiteTwoFactor   serial_Excel_hullWhiteTwoFactor   = serial_Excel_underlyingModel_para.Excel_hullWhiteTwoFactor_;

            this.currentValue_ = serial_Excel_hullWhiteTwoFactor.CurrentValue_.ValueStr;

            this.alpha_ = serial_Excel_hullWhiteTwoFactor.Alpha_.ValueStr;

            this.volatility_ = serial_Excel_hullWhiteTwoFactor.Volatility_.ValueStr;

            FpmlSerializedCSharp.Excel_rateInfo serial_excel_rateInfo = serial_Excel_hullWhiteTwoFactor.Excel_rateInfo_;
            string excel_rateInfotype = serial_excel_rateInfo.Excel_type_.ValueStr;

            this.excel_rateInfoViewModel_ = Excel_rateInfoViewModel.CreateExcel_rateInfo(excel_rateInfotype);
            this.excel_rateInfoViewModel_.setFromSerial(serial_excel_rateInfo);

            this.linkedCurveCode_ = serial_Excel_hullWhiteTwoFactor.LinkedCurveCode_.ValueStr;

            FpmlSerializedCSharp.Excel_yieldCurve serial_excel_yieldCurve = serial_Excel_hullWhiteTwoFactor.Excel_yieldCurve_;
            string excel_yieldCurvetype = serial_excel_yieldCurve.Excel_type_.ValueStr;

            this.excel_yieldCurveViewModel_ = Excel_yieldCurveViewModel.CreateExcel_yieldCurve(excel_yieldCurvetype);
            this.excel_yieldCurveViewModel_.setFromSerial(serial_excel_yieldCurve);

            this.vba_description_ = serial_Excel_hullWhiteTwoFactor.Vba_description_.ValueStr;
        }
        public void setInterestRateInfo(Excel_interestRateViewModel e_irvm)
        {
            Excel_rateInfoViewModel e_rateInfoVM = new Excel_rateInfoViewModel();

            e_rateInfoVM.Tenor_     = e_irvm.Tenor_;
            e_rateInfoVM.LegTenor_  = e_irvm.LegTenor_;
            e_rateInfoVM.IndexType_ = e_irvm.RateType_;
            e_rateInfoVM.Currency_  = e_irvm.Currency_;

            this.Excel_rateInfoViewModel_ = e_rateInfoVM;
        }
Exemplo n.º 3
0
        public Excel_rateInfoViewModel Clone()
        {
            Excel_rateInfoViewModel clone = new Excel_rateInfoViewModel();

            clone.LegTenor_  = this.legTenor_;
            clone.IndexType_ = this.indexType_;
            clone.Tenor_     = this.tenor_;
            clone.Currency_  = this.currency_;

            return(clone);
        }
        public override void setFromSerial(FpmlSerializedCSharp.ISerialized serial_Class)
        {
            FpmlSerializedCSharp.Excel_underlyingModel_para serial_Excel_underlyingModel_para = serial_Class as FpmlSerializedCSharp.Excel_underlyingModel_para;
            FpmlSerializedCSharp.Excel_hullWhiteOneFactor   serial_Excel_hullWhiteOneFactor   = serial_Excel_underlyingModel_para.Excel_hullWhiteOneFactor_;

            this.currentValue_    = serial_Excel_hullWhiteOneFactor.CurrentValue_.ValueStr;
            this.alpha_           = serial_Excel_hullWhiteOneFactor.Alpha_.ValueStr;
            this.volatility_      = serial_Excel_hullWhiteOneFactor.Volatility_.ValueStr;
            this.linkedCurveCode_ = serial_Excel_hullWhiteOneFactor.LinkedCurveCode_.ValueStr;

            FpmlSerializedCSharp.Excel_rateInfo serial_excel_rateInfo = serial_Excel_hullWhiteOneFactor.Excel_rateInfo_;
            this.excel_rateInfoViewModel_ = new Excel_rateInfoViewModel();
            this.excel_rateInfoViewModel_.setFromSerial(serial_excel_rateInfo);

            FpmlSerializedCSharp.Excel_yieldCurve serial_excel_yieldCurve = serial_Excel_hullWhiteOneFactor.Excel_yieldCurve_;
            this.excel_yieldCurveViewModel_ = new Excel_yieldCurveViewModel();
            this.excel_yieldCurveViewModel_.setFromSerial(serial_excel_yieldCurve);
        }
        public Excel_rateInfoViewModel Clone()
        {
            Excel_rateInfoViewModel clone = new Excel_rateInfoViewModel();

            clone.LegTenor_ = this.legTenor_;
            clone.IndexType_ = this.indexType_;
            clone.Tenor_ = this.tenor_;
            clone.Currency_ = this.currency_;

            return clone;
        }
        public void setInterestRateInfo(Excel_interestRateViewModel e_irvm)
        {
            Excel_rateInfoViewModel e_rateInfoVM = new Excel_rateInfoViewModel();

            e_rateInfoVM.Tenor_ = e_irvm.Tenor_;
            e_rateInfoVM.LegTenor_ = e_irvm.LegTenor_;
            e_rateInfoVM.IndexType_ = e_irvm.RateType_;
            e_rateInfoVM.Currency_ = e_irvm.Currency_;

            this.Excel_rateInfoViewModel_ = e_rateInfoVM;
        }
        public override void setFromSerial(FpmlSerializedCSharp.ISerialized serial_Class)
        {
            FpmlSerializedCSharp.Excel_underlyingModel_para serial_Excel_underlyingModel_para = serial_Class as FpmlSerializedCSharp.Excel_underlyingModel_para;
            FpmlSerializedCSharp.Excel_hullWhiteOneFactor serial_Excel_hullWhiteOneFactor = serial_Excel_underlyingModel_para.Excel_hullWhiteOneFactor_;

            this.currentValue_ = serial_Excel_hullWhiteOneFactor.CurrentValue_.ValueStr;
            this.alpha_ = serial_Excel_hullWhiteOneFactor.Alpha_.ValueStr;
            this.volatility_ = serial_Excel_hullWhiteOneFactor.Volatility_.ValueStr;
            this.linkedCurveCode_ = serial_Excel_hullWhiteOneFactor.LinkedCurveCode_.ValueStr;

            FpmlSerializedCSharp.Excel_rateInfo serial_excel_rateInfo = serial_Excel_hullWhiteOneFactor.Excel_rateInfo_;
            this.excel_rateInfoViewModel_ = new Excel_rateInfoViewModel();
            this.excel_rateInfoViewModel_.setFromSerial(serial_excel_rateInfo);
            
            FpmlSerializedCSharp.Excel_yieldCurve serial_excel_yieldCurve = serial_Excel_hullWhiteOneFactor.Excel_yieldCurve_;
            this.excel_yieldCurveViewModel_ = new Excel_yieldCurveViewModel();
            this.excel_yieldCurveViewModel_.setFromSerial(serial_excel_yieldCurve);
  
        }
 public override void setFromSerial(FpmlSerializedCSharp.ISerialized serial_Class)
 {
     FpmlSerializedCSharp.Excel_underlyingModel_para serial_Excel_underlyingModel_para = serial_Class as FpmlSerializedCSharp.Excel_underlyingModel_para;
     FpmlSerializedCSharp.Excel_hullWhiteOneFactor serial_Excel_hullWhiteOneFactor = serial_Excel_underlyingModel_para.Excel_hullWhiteOneFactor_;
 
     this.currentValue_ = serial_Excel_hullWhiteOneFactor.CurrentValue_.ValueStr;
     
     this.alpha_ = serial_Excel_hullWhiteOneFactor.Alpha_.ValueStr;
     
     this.volatility_ = serial_Excel_hullWhiteOneFactor.Volatility_.ValueStr;
     
     FpmlSerializedCSharp.Excel_rateInfo serial_excel_rateInfo = serial_Excel_hullWhiteOneFactor.Excel_rateInfo_;
     string excel_rateInfotype = serial_excel_rateInfo.Excel_type_.ValueStr;
     this.excel_rateInfoViewModel_ = Excel_rateInfoViewModel.CreateExcel_rateInfo(excel_rateInfotype);
     this.excel_rateInfoViewModel_.setFromSerial(serial_excel_rateInfo);
     
     this.linkedCurveCode_ = serial_Excel_hullWhiteOneFactor.LinkedCurveCode_.ValueStr;
     
     FpmlSerializedCSharp.Excel_yieldCurve serial_excel_yieldCurve = serial_Excel_hullWhiteOneFactor.Excel_yieldCurve_;
     string excel_yieldCurvetype = serial_excel_yieldCurve.Excel_type_.ValueStr;
     this.excel_yieldCurveViewModel_ = Excel_yieldCurveViewModel.CreateExcel_yieldCurve(excel_yieldCurvetype);
     this.excel_yieldCurveViewModel_.setFromSerial(serial_excel_yieldCurve);
     
     this.vba_description_ = serial_Excel_hullWhiteOneFactor.Vba_description_.ValueStr;
     
 }
        public string set_hullWhiteModel(string underCode, double currentValue, double alpha, double sigma, YieldTermStructure fittingCurve)
        {
            try
            {
                Excel_standardHifiveParaViewModel e_sphvm = this.InstVM_.Excel_parameterViewModel_ as Excel_standardHifiveParaViewModel;

                // under 에서 tenor를 가져옴
                string tenor = "3M"; // defaultrrrr

                bool setFlag = false;

                Excel_hullWhiteOneFactorViewModel e_hwvm = new Excel_hullWhiteOneFactorViewModel();

                foreach (var item in e_sphvm.Excel_underlyingCalcInfo_paraViewModel_.Excel_underlyingInfo_paraViewModel_)
                {
                    if (underCode == item.KrCode_)
                    {
                        e_hwvm.CurrentValue_ = currentValue.ToString();

                        e_hwvm.Alpha_ = alpha.ToString();
                        e_hwvm.Volatility_ = sigma.ToString();

                        e_hwvm.Excel_yieldCurveViewModel_ = fittingCurve.Excel_yieldCurveViewModel_;

                        item.Excel_underlyingModel_paraViewModel_ = e_hwvm;

                        setFlag = true;

                    }
                }

                Excel_rateInfoViewModel e_rateInfoVM = new Excel_rateInfoViewModel();

                foreach (var item in this.InstVM_.Excel_interfaceViewModel_.Excel_underlyingCalcInfoViewModel_.Excel_underlyingInfoViewModel_)
                {
                    if (underCode == item.KrCode_)
                    {
                        Excel_interestRateViewModel e_irvm = item as Excel_interestRateViewModel;

                        e_hwvm.setInterestRateInfo(e_irvm);
                    }
                }



                if (!setFlag)
                {
                    throw new Exception(underCode + " doesn't exist");
                }

                return "set hullWhit_model complete : " + underCode;
            }
            catch (Exception e)
            {
                return "set fail : " + e.Message;
            }
        }