private void UnderlyingAdd_Button_Click(object sender, RoutedEventArgs e)
        {
            Window w = new Window();

            //Excel_underlyingLoaderView e_ulv = new Excel_underlyingLoaderView();

            Excel_underlyingLoaderViewModel e_ulvm = new Excel_underlyingLoaderViewModel();

            w.Width   = 600;
            w.Height  = 400;
            w.Content = e_ulvm.view();

            if (w.ShowDialog() == true)
            {
                string underType = e_ulvm.SelectedUnderlyingVM_.Excel_type_;
                string code      = e_ulvm.SelectedUnderlyingVM_.KrCode_;

                // default로 basePrice effective일로 함.
                e_ulvm.SelectedUnderlyingVM_.BasePrice_
                    = Excel_loaderViewModel.loadMarketData(this.viewModel_.EffectiveDate_, underType, code);

                this.viewModel_.addUnderlyingInfoVM(e_ulvm.SelectedUnderlyingVM_);
            }
            else
            {
            }

            //this.viewModel_.Excel_underlyingInfoViewModel_.Add();
        }
Beispiel #2
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 static Excel_marketDataSymbol getDefinedSymbol(string code)
        {
            MARKETDATA_SYMBOL_INFO_Table_DAO dao = new MARKETDATA_SYMBOL_INFO_Table_DAO();

            dao.SYMBOL_ = code.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);

            return(e_mds);
        }
        public void buildFromTradeString(TradeString tradeString)
        {
            this.excel_underlyingInfoViewModel_.Clear();

            DateTime effectiveDate = StringConverter.xmlDateToDateTime(tradeString.EffectiveDate_);

            foreach (var item in tradeString.UnderlyingList_)
            {
                this.excel_underlyingInfoViewModel_.Add(Excel_loaderViewModel.loadUnderInfo(effectiveDate, item));
            }
        }
        private DateTime loadLastPositionDate()
        {
            // PROGRAM VARIABLE
            // calendar

            // market data 가 존재하는 일자로 ㄱㄱ



            //while (

            return(Excel_loaderViewModel.availableMarketDataDate());
        }
        private void addUnderlying(DateTime effDate, string underCode)
        {
            foreach (var item in this.instVM_.Excel_interfaceViewModel_.Excel_underlyingCalcInfoViewModel_.Excel_underlyingInfoViewModel_)
            {
                if (underCode == item.KrCode_)
                {
                    return;
                }
            }

            this.instVM_.Excel_interfaceViewModel_.Excel_underlyingCalcInfoViewModel_.Excel_underlyingInfoViewModel_
            .Add(Excel_loaderViewModel.loadUnderInfo2(effDate, underCode));
        }
        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);
        }
Beispiel #8
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);
        }
Beispiel #9
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;
            }
        }