Пример #1
0
        // product 화면에 underlying이 추가댔을 경우 그 이벤트를 받는 놈.
        public override void instrumentEventObserver(object sender, PropertyChangedEventArgs e)
        {
            Excel_underlyingCalcInfoViewModel senderVM = sender as Excel_underlyingCalcInfoViewModel;

            int count = senderVM.Excel_underlyingInfoViewModel_.Count;

            if (count > 0)
            {
                Excel_underlyingInfoViewModel e_uivm = senderVM.Excel_underlyingInfoViewModel_[count - 1];

                //// model associated type defined class
                //UnderlyingModelSetting ums = new UnderlyingModelSetting();

                // 원래 setting 해논 놈을 씀 UnderlyingModelSetting_
                Excel_underlyingInfo_paraViewModel e_uipvm =
                    this.UnderlyingModelSetting_.getUnderlyingParameterModel(e_uivm);

                this.excel_underlyingCalcInfo_paraViewModel_.
                Excel_underlyingInfo_paraViewModel_.Add(e_uipvm);

                this.excel_underlyingCalcInfo_paraViewModel_.
                Excel_correlationInfo_paraViewModel_.addUnderlying(e_uipvm.UnderNameTrans_.Value_);
            }
            else
            {
                OutputLogViewModel.addResult("input underlying num is 0");
            }
        }
        public void setFromSerial(FpmlSerializedCSharp.ISerialized serial_Class)
        {
            FpmlSerializedCSharp.Excel_underlyingCalcInfo serial_Excel_underlyingCalcInfo = serial_Class as FpmlSerializedCSharp.Excel_underlyingCalcInfo;

            List <FpmlSerializedCSharp.Excel_underlyingInfo> serial_excel_underlyingInfo = serial_Excel_underlyingCalcInfo.Excel_underlyingInfo_;

            // 역시 이미 있음.
            //this.excel_underlyingInfoViewModel_ = new ObservableCollection<Excel_underlyingInfoViewModel>();
            this.excel_underlyingInfoViewModel_.Clear();
            foreach (var item in serial_excel_underlyingInfo)
            {
                string type = item.Excel_type_.ValueStr;
                Excel_underlyingInfoViewModel viewModel = Excel_underlyingInfoViewModel.CreateExcel_underlyingInfo(type);
                viewModel.setFromSerial(item);
                //this.excel_underlyingInfoViewModel_.Add(viewModel);
                this.addUnderlyingInfoVM(viewModel);
            }

            //List<FpmlSerializedCSharp.Excel_underlyingCalcID> serial_excel_underlyingCalcID = serial_Excel_underlyingCalcInfo.Excel_underlyingCalcID_;
            //this.excel_underlyingCalcIDViewModel_ = new ObservableCollection<Excel_underlyingCalcIDViewModel>();
            //foreach (var item in serial_excel_underlyingCalcID)
            //{
            //    string type = item.Type_.ValueStr;
            //    Excel_underlyingCalcIDViewModel viewModel = Excel_underlyingCalcIDViewModel.CreateExcel_underlyingCalcID(type);
            //    viewModel.setFromSerial(item);
            //    this.excel_underlyingCalcIDViewModel_.Add(viewModel);
            //}

            //this.view_ = new Excel_underlyingCalcInfoView();
            //this.view_.DataContext = this;
        }
Пример #3
0
        public static Excel_underlyingInfoViewModel loadUnderInfo(DateTime refDate, string nameTrans)
        {
            // nameTrans를 가지고 code를 찾음.

            MARKETDATA_SYMBOL_INFO_Table_DAO dao = new MARKETDATA_SYMBOL_INFO_Table_DAO();

            dao.NAME_KOR_ = (nameTrans.Trim()).ToUpper();

            dao.selectNAME_KOR(DataBaseConnectManager.ConnectionFactory("myDB"));

            // 코드를 찾아서 symbol을 로드함.

            // symbol을 통해서 type을 로드함

            // type을 통해서 symbolVM을 만들음

            string underType = dao.SYMBOL_TYPE_;

            Excel_marketDataSymbol e_mds = Excel_loaderViewModel.CreateSymbolViewModel(underType);

            e_mds.setFromDAO(dao);

            Excel_underlyingInfoViewModel e_uivm = e_mds.underlyingInfoVM();

            e_uivm.BasePrice_ = e_mds.dataLoad(Excel_loaderViewModel.availableMarketDataDate(refDate), e_mds.Symbol_);

            return(e_uivm);
        }
        public Excel_underlyingModel_paraViewModel underModel(Excel_underlyingInfoViewModel excel_uivm)
        {
            // if 이놈이 stock이면 
            string underType = excel_uivm.Excel_type_;

            if (underType.ToUpper() == "STOCK" || underType.ToUpper() == "EXCEL_STOCK" || underType.ToUpper() == "EQUITY")
            {
                return this.StockParaSetting_.underModel(excel_uivm, owner_parameterSettingManager_.Excel_InstrumentViewModel_, owner_parameterSettingManager_.ReferenceDate_);

            }
            else if (underType.ToUpper() == "INTERESTRATE" || underType.ToUpper() == "EXCEL_INTERESTRATE")
            {
                return this.InterestRateParaSetting_.underModel(excel_uivm, owner_parameterSettingManager_.Excel_InstrumentViewModel_, owner_parameterSettingManager_.ReferenceDate_);
            }
            else if (underType.ToUpper() == "FXRATE" )
            {
                return this.FxRateParaSetting_.underModel(excel_uivm, owner_parameterSettingManager_.Excel_InstrumentViewModel_, owner_parameterSettingManager_.ReferenceDate_);
            }
            else if (underType.ToUpper() == "INDEX" || 
                     underType.ToUpper() == "INDEX_TYPE" || 
                     underType.ToUpper() == "EXCEL_INDEXTYPE")
            {
                Excel_indexTypeViewModel excel_itvm = excel_uivm as Excel_indexTypeViewModel;

                string subType = excel_itvm.Sub_type_.ToUpper();

                if (subType == "STOCK")
                {
                    return this.StockParaSetting_.underModel(excel_uivm, owner_parameterSettingManager_.Excel_InstrumentViewModel_, owner_parameterSettingManager_.ReferenceDate_);
                }
                else if (subType == "INTERESTRATE")
                { 
                    return this.InterestRateParaSetting_.underModel(excel_uivm, owner_parameterSettingManager_.Excel_InstrumentViewModel_, owner_parameterSettingManager_.ReferenceDate_);
                }
                else if (subType == "FXRATE")
                {
                    return this.FxRateParaSetting_.underModel(excel_uivm, owner_parameterSettingManager_.Excel_InstrumentViewModel_, owner_parameterSettingManager_.ReferenceDate_);
                }
                else
                {
                    OutputLogViewModel.addResult("unknown subtype in indexType underlying " + subType);
                    
                    throw new NotImplementedException();
                }
            }
            else
            {
                OutputLogViewModel.addResult("unknown underlying type" + underType);

                throw new NotImplementedException();

                //return new Excel_forwardModelViewModel();
            }


        }
 public void buildParaSetting(Excel_underlyingInfoViewModel e_uivm)
 {
     this.Excel_type_     = e_uivm.Excel_type_;
     this.KrCode_         = e_uivm.KrCode_;
     this.UnderNameTrans_ = e_uivm.NameTrans_;
     this.BasePrice_      = e_uivm.BasePrice_;
     this.Tenor_          = e_uivm.Tenor_;
     this.Sub_type_       = e_uivm.Sub_type_;
     this.LinkedCurve_    = e_uivm.LinkedCurveCode_;
 }
        private void UnderlyingDataGrid__PreviewKeyDown(object sender, KeyEventArgs e)
        {
            Excel_underlyingInfoViewModel e_ivm = ((DataGrid)sender).SelectedItem as Excel_underlyingInfoViewModel;

            if (Key.Delete == e.Key)
            {
                this.viewModel_.Excel_underlyingInfoViewModel_.Remove(e_ivm);
                //this.UnderlyingDataGrid_.Items.Refresh();
            }
        }
Пример #7
0
        public Excel_underlyingModel_paraViewModel underModel(Excel_underlyingInfoViewModel excel_uivm)
        {
            // if 이놈이 stock이면
            string underType = excel_uivm.Excel_type_;

            if (underType.ToUpper() == "STOCK" || underType.ToUpper() == "EXCEL_STOCK" || underType.ToUpper() == "EQUITY")
            {
                return(this.StockParaSetting_.underModel(excel_uivm, owner_parameterSettingManager_.Excel_InstrumentViewModel_, owner_parameterSettingManager_.ReferenceDate_));
            }
            else if (underType.ToUpper() == "INTERESTRATE" || underType.ToUpper() == "EXCEL_INTERESTRATE")
            {
                return(this.InterestRateParaSetting_.underModel(excel_uivm, owner_parameterSettingManager_.Excel_InstrumentViewModel_, owner_parameterSettingManager_.ReferenceDate_));
            }
            else if (underType.ToUpper() == "FXRATE")
            {
                return(this.FxRateParaSetting_.underModel(excel_uivm, owner_parameterSettingManager_.Excel_InstrumentViewModel_, owner_parameterSettingManager_.ReferenceDate_));
            }
            else if (underType.ToUpper() == "INDEX" ||
                     underType.ToUpper() == "INDEX_TYPE" ||
                     underType.ToUpper() == "EXCEL_INDEXTYPE")
            {
                Excel_indexTypeViewModel excel_itvm = excel_uivm as Excel_indexTypeViewModel;

                string subType = excel_itvm.Sub_type_.ToUpper();

                if (subType == "STOCK")
                {
                    return(this.StockParaSetting_.underModel(excel_uivm, owner_parameterSettingManager_.Excel_InstrumentViewModel_, owner_parameterSettingManager_.ReferenceDate_));
                }
                else if (subType == "INTERESTRATE")
                {
                    return(this.InterestRateParaSetting_.underModel(excel_uivm, owner_parameterSettingManager_.Excel_InstrumentViewModel_, owner_parameterSettingManager_.ReferenceDate_));
                }
                else if (subType == "FXRATE")
                {
                    return(this.FxRateParaSetting_.underModel(excel_uivm, owner_parameterSettingManager_.Excel_InstrumentViewModel_, owner_parameterSettingManager_.ReferenceDate_));
                }
                else
                {
                    OutputLogViewModel.addResult("unknown subtype in indexType underlying " + subType);

                    throw new NotImplementedException();
                }
            }
            else
            {
                OutputLogViewModel.addResult("unknown underlying type" + underType);

                throw new NotImplementedException();

                //return new Excel_forwardModelViewModel();
            }
        }
        public override string value(DateTime dateTime, Excel_instrumentViewModel excel_instrumentViewModel, Excel_underlyingInfoViewModel excel_uivm)
        {
            TD_MRSTOCKFACTOR_Table_DAO dao = new TD_MRSTOCKFACTOR_Table_DAO();

            dao.STOCK_ID_ = excel_uivm.KrCode_;
            dao.STD_DATE_ = StringConverter.dbDateTimeToDateString(dateTime);

            dao.select_ID_Date(DataBaseConnectManager.ConnectionFactory("MRO"));

            string v = dao.DIVIDEND_RATE_;

            return v;
        }
        public void buildParaSetting(Excel_underlyingInfoViewModel e_uivm, ParameterSettingManager paraSettingManager)
        {
            this.Excel_type_     = e_uivm.Excel_type_;
            this.KrCode_         = e_uivm.KrCode_;
            this.UnderNameTrans_ = e_uivm.NameTrans_;
            this.BasePrice_      = e_uivm.BasePrice_;
            this.Tenor_          = e_uivm.Tenor_;
            this.Sub_type_       = e_uivm.Sub_type_;
            this.LinkedCurve_    = e_uivm.LinkedCurveCode_;

            //this.CurrentValue_ = ? // model에서 setting 을 통해 set됨

            this.excel_underlyingModel_paraViewModel_ =
                paraSettingManager.UnderlyingParaSetting_.underModel(e_uivm);
        }
        public void setFromSerial(FpmlSerializedCSharp.ISerialized serial_Class)
        {
            FpmlSerializedCSharp.Excel_underlyingCalcInfo serial_Excel_underlyingCalcInfo = serial_Class as FpmlSerializedCSharp.Excel_underlyingCalcInfo;

            List <FpmlSerializedCSharp.Excel_underlyingInfo> serial_excel_underlyingInfo = serial_Excel_underlyingCalcInfo.Excel_underlyingInfo_;

            this.excel_underlyingInfoViewModel_ = new ObservableCollection <Excel_underlyingInfoViewModel>();
            foreach (var item in serial_excel_underlyingInfo)
            {
                string type = item.Excel_type_.ValueStr;
                Excel_underlyingInfoViewModel viewModel = Excel_underlyingInfoViewModel.CreateExcel_underlyingInfo(type);
                viewModel.setFromSerial(item);
                this.excel_underlyingInfoViewModel_.Add(viewModel);
            }
        }
        public override Excel_yieldCurveViewModel value(DateTime dateTime, Excel_instrumentViewModel e_instVM, Excel_underlyingInfoViewModel excel_uivm)
        {
            Excel_interestRateViewModel e_irvm = excel_uivm as Excel_interestRateViewModel;

            ObservableCollection<Excel_irCurveDataViewModel> e_ircdvmList = new ObservableCollection<Excel_irCurveDataViewModel>();

            Excel_yieldCurveViewModel e_ycvm = new Excel_yieldCurveViewModel();

            e_ycvm.Excel_interpolationViewModel_ = Excel_interpolationViewModel_;

            e_ycvm.Code_ = "constDefaultCurve";

            e_ycvm.loadCurve(constRate_);

            return e_ycvm;
        }
        public override Excel_underlyingModel_paraViewModel underModel(Excel_underlyingInfoViewModel excel_uivm,
                                                                       Excel_instrumentViewModel excel_instrumentViewModel,
                                                                       DateTime dateTime)
        {
            Excel_geometricBMViewModel e_gbmvm = new Excel_geometricBMViewModel();

            //excel_upvm.loadMarketData(dateTime);

            string value = Excel_loaderViewModel.loadMarketData(dateTime, excel_uivm.Excel_type_, excel_uivm.KrCode_);

            e_gbmvm.CurrentValue_ = value;

            e_gbmvm.Drift_      = this.GBMDriftSetting_.value(dateTime, excel_instrumentViewModel, excel_uivm);
            e_gbmvm.Dividend_   = this.GBMDividendSetting_.value(dateTime, excel_instrumentViewModel, excel_uivm);
            e_gbmvm.Volatility_ = this.GBMVolatilitySetting_.value(dateTime, excel_instrumentViewModel, excel_uivm);

            return(e_gbmvm);
        }
        public override Excel_underlyingModel_paraViewModel underModel(Excel_underlyingInfoViewModel excel_uivm,
                                                                       Excel_instrumentViewModel excel_instrumentViewModel, 
                                                                       DateTime dateTime)
        {
            Excel_geometricBMViewModel e_gbmvm = new Excel_geometricBMViewModel();

            //excel_upvm.loadMarketData(dateTime);

            string value = Excel_loaderViewModel.loadMarketData(dateTime, excel_uivm.Excel_type_, excel_uivm.KrCode_);

            e_gbmvm.CurrentValue_ = value;

            e_gbmvm.Drift_ = this.GBMDriftSetting_.value(dateTime, excel_instrumentViewModel, excel_uivm);
            e_gbmvm.Dividend_ = this.GBMDividendSetting_.value(dateTime, excel_instrumentViewModel, excel_uivm);
            e_gbmvm.Volatility_ = this.GBMVolatilitySetting_.value(dateTime, excel_instrumentViewModel, excel_uivm);

            return e_gbmvm;

        }
Пример #14
0
        public override Excel_underlyingModel_paraViewModel underModel(Excel_underlyingInfoViewModel excel_uivm, Excel_instrumentViewModel excel_instrumentViewModel, DateTime dateTime)
        {
            Excel_hullWhiteOneFactorViewModel e_hwofvm = new Excel_hullWhiteOneFactorViewModel();

            Excel_interestRateViewModel e_irvm = excel_uivm as Excel_interestRateViewModel;

            string value = Excel_loaderViewModel.loadMarketData(dateTime, excel_uivm.Excel_type_, excel_uivm.KrCode_);

            e_hwofvm.CurrentValue_ = value;

            e_hwofvm.Alpha_      = this.HullWhite_AlphaSetting_.value(dateTime, excel_instrumentViewModel, excel_uivm);
            e_hwofvm.Volatility_ = this.HullWhite_SigmaSetting_.value(dateTime, excel_instrumentViewModel, excel_uivm);

            e_hwofvm.setInterestRateInfo(e_irvm);

            e_hwofvm.Excel_yieldCurveViewModel_ = this.HullWhite_FittingCurveSetting_.value(dateTime, excel_instrumentViewModel, excel_uivm);

            return(e_hwofvm);
        }
        public override string value(DateTime dateTime, Excel_instrumentViewModel e_instVM, Excel_underlyingInfoViewModel excel_uivm)
        {
            OTC_TD_MRSTOCKFACTORVOL_Table_DAO dao = new OTC_TD_MRSTOCKFACTORVOL_Table_DAO();

            dao.STD_DATE_ = StringConverter.dbDateTimeToDateString(dateTime);
            dao.STOCK_ID_ = excel_uivm.KrCode_;
            dao.KR_CODE_ = e_instVM.MasterInformationViewModel_.Export_itemcode_;

            string sql = dao.select_date_code_id(DataBaseConnectManager.ConnectionFactory("MRO"));

            if (dao.STOCK_ID_ == "KR7060980000")
            {
                dao.VOL_ = "0.33";
            }

            //SQL_Logger.addLog(sql);

            return dao.VOL_;
        }
        public Excel_underlyingInfo_paraViewModel getUnderlyingParameterModel(Excel_underlyingInfoViewModel e_uivm)
        {
            Excel_underlyingInfo_paraViewModel e_uipvm = new Excel_underlyingInfo_paraViewModel();

            if (e_uivm.Excel_type_.ToUpper() == "STOCK")
            {
                e_uipvm.KrCode_ = e_uivm.KrCode_;
                //e_uipvm.UnderName_ = e_uivm.Name_;
                //e_uipvm.Model_ = "GBM";

                Excel_geometricBMViewModel e_gbmvm = new Excel_geometricBMViewModel();

                e_gbmvm.Code_ = e_uivm.KrCode_;

                e_uipvm.Excel_underlyingModel_paraViewModel_ = e_gbmvm;

            }
            else if (e_uivm.Excel_type_.ToUpper() == "INTERESTRATE")
            {
                e_uipvm.KrCode_ = e_uivm.KrCode_;
                //e_uipvm.UnderName_ = e_uivm.Name_;
                //e_uipvm.Model_ = "HullWhiteOne";

                Excel_hullWhiteOneFactorViewModel e_hwofvm = new Excel_hullWhiteOneFactorViewModel();

                Excel_interestRateViewModel e_irvm = e_uivm as Excel_interestRateViewModel;

                e_hwofvm.Code_ = e_uivm.KrCode_;

                e_hwofvm.setInterestRateInfo(e_irvm);

                e_uipvm.Excel_underlyingModel_paraViewModel_ = e_hwofvm;
            }
            else
            {
                throw new NotImplementedException();
            }

            e_uipvm.Excel_underlyingModel_paraViewModel_.parameterLoad(
                this.ParameterSettingManager_);

            return e_uipvm;
        }
Пример #17
0
        public Excel_underlyingInfo_paraViewModel getUnderlyingParameterModel(Excel_underlyingInfoViewModel e_uivm)
        {
            Excel_underlyingInfo_paraViewModel e_uipvm = new Excel_underlyingInfo_paraViewModel();

            if (e_uivm.Excel_type_.ToUpper() == "STOCK")
            {
                e_uipvm.KrCode_ = e_uivm.KrCode_;
                //e_uipvm.UnderName_ = e_uivm.Name_;
                //e_uipvm.Model_ = "GBM";

                Excel_geometricBMViewModel e_gbmvm = new Excel_geometricBMViewModel();

                e_gbmvm.Code_ = e_uivm.KrCode_;

                e_uipvm.Excel_underlyingModel_paraViewModel_ = e_gbmvm;
            }
            else if (e_uivm.Excel_type_.ToUpper() == "INTERESTRATE")
            {
                e_uipvm.KrCode_ = e_uivm.KrCode_;
                //e_uipvm.UnderName_ = e_uivm.Name_;
                //e_uipvm.Model_ = "HullWhiteOne";

                Excel_hullWhiteOneFactorViewModel e_hwofvm = new Excel_hullWhiteOneFactorViewModel();

                Excel_interestRateViewModel e_irvm = e_uivm as Excel_interestRateViewModel;

                e_hwofvm.Code_ = e_uivm.KrCode_;

                e_hwofvm.setInterestRateInfo(e_irvm);

                e_uipvm.Excel_underlyingModel_paraViewModel_ = e_hwofvm;
            }
            else
            {
                throw new NotImplementedException();
            }

            e_uipvm.Excel_underlyingModel_paraViewModel_.parameterLoad(
                this.ParameterSettingManager_);

            return(e_uipvm);
        }
        public override string value(DateTime dateTime, Excel_instrumentViewModel e_instVM, Excel_underlyingInfoViewModel excel_uivm)
        {
            // 국고 커브를 로드함

            DateTime maturity = e_instVM.Excel_interfaceViewModel_.Excel_issueInfoViewModel_.MaturityDate_;

            Excel_yieldCurveViewModel e_ycvm =
                e_instVM.Excel_parameterViewModel_.ParameterSettingManager_.DiscountCurveParaSetting_.discountCurve(dateTime,"KRW");

            QLNet.YieldTermStructure q_y = e_ycvm.yieldCurve();

            TimeSpan timeSpan = maturity - dateTime;

            double t = timeSpan.TotalDays / 365;

            InterestRate rate = q_y.zeroRate(t, QLNet.Compounding.Compounded);
            
            double drift = rate.value();
            
            return drift.ToString();
        }
Пример #19
0
        public static Excel_underlyingInfoViewModel loadUnderInfo2(DateTime refDate, string nameTrans)
        {
            // nameTrans를 가지고 code를 찾음.

            try
            {
                MARKETDATA_SYMBOL_INFO_Table_DAO dao = new MARKETDATA_SYMBOL_INFO_Table_DAO();

                dao.SYMBOL_ = nameTrans.Trim();

                dao.select(DataBaseConnectManager.ConnectionFactory("myDB"));

                // 코드를 찾아서 symbol을 로드함.

                // symbol을 통해서 type을 로드함

                // type을 통해서 symbolVM을 만들음

                string underType = dao.SYMBOL_TYPE_;

                if (underType == null)
                {
                    throw new Exception("symbol doesn't exist in symbolList : " + dao.SYMBOL_);
                }

                Excel_marketDataSymbol e_mds = Excel_loaderViewModel.CreateSymbolViewModel(underType);

                e_mds.setFromDAO(dao);

                Excel_underlyingInfoViewModel e_uivm = e_mds.underlyingInfoVM();

                e_uivm.BasePrice_ = e_mds.dataLoad(Excel_loaderViewModel.availableMarketDataDate(refDate), e_mds.Symbol_);

                return(e_uivm);
            }
            catch (Exception)
            {
                throw;
            }
        }
        public override Excel_yieldCurveViewModel value(DateTime dateTime, Excel_instrumentViewModel e_instVM, Excel_underlyingInfoViewModel excel_uivm)
        {
            IRCurveMarketDataLoader curveLoader = IRCurveMarketDataLoader.CreateMarketDataLoader("MRO");

            Excel_interestRateViewModel e_irvm = excel_uivm as Excel_interestRateViewModel;

            ObservableCollection<Excel_irCurveDataViewModel> e_ircdvmList = new ObservableCollection<Excel_irCurveDataViewModel>();

            curveLoader.load(dateTime, e_irvm.LinkedCurveCode_, e_ircdvmList);
            //e_icsvm.Symbol_ = excel_uivm.KrCode_;

            //e_icsvm.dataLoad(dateTime, e_irvm.LinkedCurveCode_);

            Excel_yieldCurveViewModel e_ycvm = new Excel_yieldCurveViewModel();

            e_ycvm.Excel_interpolationViewModel_ = Excel_interpolationViewModel_;

            e_ycvm.Code_ = e_ircdvmList[0].Curve_code_;

            e_ycvm.Excel_rateDataViewModel_ = e_ircdvmList[0].Excel_rateDataViewModelList_;

            return e_ycvm;
        }
 public abstract Excel_underlyingModel_paraViewModel underModel(Excel_underlyingInfoViewModel excel_uivm,
                                                                Excel_instrumentViewModel excel_instrumentViewModel,
                                                                DateTime dateTime);
        public override string value(DateTime dateTime, Excel_instrumentViewModel e_instVM, Excel_underlyingInfoViewModel excel_uivm)
        {
            OTC_TD_MRSTOCKFACTORVOL_Table_DAO dao = new OTC_TD_MRSTOCKFACTORVOL_Table_DAO();

            dao.STD_DATE_ = StringConverter.dbDateTimeToDateString(dateTime);
            dao.STOCK_ID_ = excel_uivm.KrCode_;
            dao.KR_CODE_  = e_instVM.MasterInformationViewModel_.Export_itemcode_;

            string sql = dao.select_date_code_id(DataBaseConnectManager.ConnectionFactory("MRO"));

            if (dao.STOCK_ID_ == "KR7060980000")
            {
                dao.VOL_ = "0.33";
            }

            //SQL_Logger.addLog(sql);

            return(dao.VOL_);
        }
 public override string value(DateTime dateTime, Excel_instrumentViewModel excel_instrumentViewModel, Excel_underlyingInfoViewModel excel_uivm)
 {
     return this.constDiv_;
 }
        public override Excel_yieldCurveViewModel value(DateTime dateTime, Excel_instrumentViewModel e_instVM, Excel_underlyingInfoViewModel excel_uivm)
        {
            IRCurveMarketDataLoader curveLoader = IRCurveMarketDataLoader.CreateMarketDataLoader("MRO");

            Excel_interestRateViewModel e_irvm = excel_uivm as Excel_interestRateViewModel;

            ObservableCollection <Excel_irCurveDataViewModel> e_ircdvmList = new ObservableCollection <Excel_irCurveDataViewModel>();

            curveLoader.load(dateTime, e_irvm.LinkedCurveCode_, e_ircdvmList);
            //e_icsvm.Symbol_ = excel_uivm.KrCode_;

            //e_icsvm.dataLoad(dateTime, e_irvm.LinkedCurveCode_);

            Excel_yieldCurveViewModel e_ycvm = new Excel_yieldCurveViewModel();

            e_ycvm.Excel_interpolationViewModel_ = Excel_interpolationViewModel_;

            e_ycvm.Code_ = e_ircdvmList[0].Curve_code_;

            e_ycvm.Excel_rateDataViewModel_ = e_ircdvmList[0].Excel_rateDataViewModelList_;

            return(e_ycvm);
        }
 public Excel_underlyingModel_paraViewModel underModel(Excel_underlyingInfoViewModel excel_uivm, Excel_instrumentViewModel excel_instrumentViewModel, DateTime dateTime)
 {
     throw new NotImplementedException();
 }
Пример #26
0
 public override string value(DateTime dateTime, Excel_instrumentViewModel excel_instrumentViewModel, Excel_underlyingInfoViewModel excel_uivm)
 {
     return(this.constDiv_);
 }
 public void buildParaSetting(Excel_underlyingInfoViewModel e_uivm)
 {
     this.Excel_type_ = e_uivm.Excel_type_;
     this.KrCode_ = e_uivm.KrCode_;
     this.UnderNameTrans_ = e_uivm.NameTrans_;
     this.BasePrice_ = e_uivm.BasePrice_;
     this.Tenor_ = e_uivm.Tenor_;
     this.Sub_type_ = e_uivm.Sub_type_;
     this.LinkedCurve_ = e_uivm.LinkedCurveCode_;
 }
Пример #28
0
 public abstract string value(DateTime dateTime, Excel_instrumentViewModel excel_instrumentViewModel, Excel_underlyingInfoViewModel excel_uivm);
 public abstract Excel_yieldCurveViewModel value(DateTime dateTime, Excel_instrumentViewModel e_instVM, Excel_underlyingInfoViewModel excel_uivm);
        public override string value(DateTime dateTime, Excel_instrumentViewModel e_instVM, Excel_underlyingInfoViewModel excel_uivm)
        {
            // 국고 커브를 로드함

            DateTime maturity = e_instVM.Excel_interfaceViewModel_.Excel_issueInfoViewModel_.MaturityDate_;

            Excel_yieldCurveViewModel e_ycvm =
                e_instVM.Excel_parameterViewModel_.ParameterSettingManager_.DiscountCurveParaSetting_.discountCurve(dateTime, "KRW");

            QLNet.YieldTermStructure q_y = e_ycvm.yieldCurve();

            TimeSpan timeSpan = maturity - dateTime;

            double t = timeSpan.TotalDays / 365;

            InterestRate rate = q_y.zeroRate(t, QLNet.Compounding.Compounded);

            double drift = rate.value();

            return(drift.ToString());
        }
Пример #31
0
        public override Excel_yieldCurveViewModel value(DateTime dateTime, Excel_instrumentViewModel e_instVM, Excel_underlyingInfoViewModel excel_uivm)
        {
            Excel_interestRateViewModel e_irvm = excel_uivm as Excel_interestRateViewModel;

            ObservableCollection <Excel_irCurveDataViewModel> e_ircdvmList = new ObservableCollection <Excel_irCurveDataViewModel>();

            Excel_yieldCurveViewModel e_ycvm = new Excel_yieldCurveViewModel();

            e_ycvm.Excel_interpolationViewModel_ = Excel_interpolationViewModel_;

            e_ycvm.Code_ = "constDefaultCurve";

            e_ycvm.loadCurve(constRate_);

            return(e_ycvm);
        }
Пример #32
0
        public override string value(DateTime dateTime, Excel_instrumentViewModel excel_instrumentViewModel, Excel_underlyingInfoViewModel excel_uivm)
        {
            TD_MRSTOCKFACTOR_Table_DAO dao = new TD_MRSTOCKFACTOR_Table_DAO();

            dao.STOCK_ID_ = excel_uivm.KrCode_;
            dao.STD_DATE_ = StringConverter.dbDateTimeToDateString(dateTime);

            dao.select_ID_Date(DataBaseConnectManager.ConnectionFactory("MRO"));

            string v = dao.DIVIDEND_RATE_;

            return(v);
        }
        public void addUnderlyingInfoVM(Excel_underlyingInfoViewModel vm)
        {
            excel_underlyingInfoViewModel_.Add(vm);

            this.NotifyPropertyChanged("Excel_underlyingInfoViewModel_");
        }
 private void UnderlyingDataGrid__SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     this.selectedViewModel_ = this.UnderlyingDataGrid_.SelectedItem as Excel_underlyingInfoViewModel;
 }
        public void buildParaSetting(Excel_underlyingInfoViewModel e_uivm, ParameterSettingManager paraSettingManager)
        {
            this.Excel_type_ = e_uivm.Excel_type_;
            this.KrCode_ = e_uivm.KrCode_;
            this.UnderNameTrans_ = e_uivm.NameTrans_;
            this.BasePrice_ = e_uivm.BasePrice_;
            this.Tenor_ = e_uivm.Tenor_;
            this.Sub_type_ = e_uivm.Sub_type_;
            this.LinkedCurve_ = e_uivm.LinkedCurveCode_;

            //this.CurrentValue_ = ? // model에서 setting 을 통해 set됨

            this.excel_underlyingModel_paraViewModel_ =
                paraSettingManager.UnderlyingParaSetting_.underModel(e_uivm);


        }
        public void addUnderlyingInfoVM(Excel_underlyingInfoViewModel vm)
        {
            excel_underlyingInfoViewModel_.Add(vm);

            this.NotifyPropertyChanged("Excel_underlyingInfoViewModel_");
        }
 public abstract Excel_underlyingModel_paraViewModel underModel(Excel_underlyingInfoViewModel excel_uivm,
                                                                Excel_instrumentViewModel excel_instrumentViewModel,
                                                                DateTime dateTime);
 public override string value(DateTime dateTime, Excel_instrumentViewModel e_instVM, Excel_underlyingInfoViewModel excel_uivm)
 {
     return constVol_;
 }
 private void UnderlyingDataGrid__SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     this.selectedViewModel_ = this.UnderlyingDataGrid_.SelectedItem as Excel_underlyingInfoViewModel;
 }
 public override string value(DateTime dateTime, Excel_instrumentViewModel e_instVM, Excel_underlyingInfoViewModel excel_uivm)
 {
     return(constVol_);
 }