private void ViewModelChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            this.viewModel_ = this.DataContext as UnderlyingInfo_paraViewModel;
            this.underParaDataGrid_.ItemsSource = this.viewModel_.Underlying_paraViewModel_;

            this.corrParaDataGrid_.ItemsSource = this.viewModel_.CorrelationInfo_paraViewModel_.CorrelationDataList_;
        }
Exemplo n.º 2
0
        private void ViewModelChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            this.viewModel_ = this.DataContext as UnderlyingInfo_paraViewModel;
            this.underParaDataGrid_.ItemsSource = this.viewModel_.Underlying_paraViewModel_;

            this.corrParaDataGrid_.ItemsSource = this.viewModel_.CorrelationInfo_paraViewModel_.CorrelationDataList_;
        }
Exemplo n.º 3
0
        // ----------------------------------------------------------------------
        // 데이터를 로드하고, 기본 골격을 잡는 곳
        // ----------------------------------------------------------------------

        public override void initializeParameter(InstrumentViewModel instrumentViewModel)
        {
            StandardInstViewModel   standInstVM      = instrumentViewModel as StandardInstViewModel;
            IndexUnderInfoViewModel indexUnderInfoVM = standInstVM.UnderlyingViewModel_ as IndexUnderInfoViewModel;

            this.underlyingInfo_paraViewModel_ = new UnderlyingInfo_paraViewModel();
            this.underlyingInfo_paraViewModel_.initializeParameter(indexUnderInfoVM);
        }
Exemplo n.º 4
0
        // ----------------------------------------------------------------------
        // 데이터를 로드하고, 기본 골격을 잡는 곳
        // ----------------------------------------------------------------------

        public override void initializeParameter(InstrumentViewModel instrumentViewModel)
        {
            StandardInstViewModel   standInstVM      = instrumentViewModel as StandardInstViewModel;
            IndexUnderInfoViewModel indexUnderInfoVM = standInstVM.UnderlyingViewModel_ as IndexUnderInfoViewModel;

            this.calculationAmountViewModel_ = new CalculationAmountViewModel();

            this.underlyingInfo_paraViewModel_ = new UnderlyingInfo_paraViewModel();
            this.underlyingInfo_paraViewModel_.initializeParameter(indexUnderInfoVM);

            this.discountCurve_paraViewModel_ = new DiscountCurve_paraViewModel();


            this.view_             = new Standard_paraView();
            this.view_.DataContext = this;
        }
        public UnderlyingInfo_paraViewModel makeParameterInfoVM(FpmlSerializedCSharp.UnderlyingInformation xml_underInfo)
        {
            UnderlyingInfo_paraViewModel underInfoParaVM = new UnderlyingInfo_paraViewModel();

            ObservableCollection <Underlying_paraViewModel> underParaVMList = new ObservableCollection <Underlying_paraViewModel>();

            List <FpmlSerializedCSharp.Index> xml_indexList = xml_underInfo.IndexUnderInfo_.Index_;

            foreach (var item in xml_indexList)
            {
                underParaVMList.Add(this.makeIndexPara(item));
            }

            // correlation
            CorrelationInfo_paraViewModel corr_paraVM = this.makeCorrPara(xml_indexList);

            return(underInfoParaVM);
        }
        private UnderlyingInfo_paraViewModel underInfo_paraVM(string itemCode)
        {
            UnderlyingInfo_paraViewModel underInfo_paraVM = new UnderlyingInfo_paraViewModel();

            QueryStr queryStr = new QueryStr(this.fileInfo_);

            queryStr.VariableMap_.Add("ITEM_CODE", itemCode);
            queryStr.VariableMap_.Add("STD_DATE", this.ReferenceDate_.ToString("yyyyMMdd"));

            conn_.addQuery("underInfo", queryStr.getQuery());

            conn_.excute();

            DataTable tb = conn_.ResultDataSet_.Tables["underInfo"];

            string krCode;
            string underName;
            string currentValue;
            string drift;
            string dividend;
            string volatility;

            List <string> underCode = new List <string>();

            foreach (DataRow item in tb.Rows)
            {
                krCode       = item["STOCK_ID"].ToString();
                underName    = item["STOCK_NAME"].ToString();
                currentValue = item["CURR_PRICE"].ToString();
                drift        = (Convert.ToDouble(item["RF"].ToString()) / 100).ToString();
                dividend     = (Convert.ToDouble(item["DIVIDEND_RATE"].ToString()) / 100).ToString();
                volatility   = (Convert.ToDouble(item["VOL"].ToString()) / 100).ToString();

                underCode.Add(krCode);

                GeometricBMViewModel gbmVM = this.makeGBM(krCode, underName, currentValue, drift, dividend, volatility);

                underInfo_paraVM.Underlying_paraViewModel_.Add(gbmVM);
            }

            underInfo_paraVM.CorrelationInfo_paraViewModel_ = this.makeCorrInfo(underCode);

            return(underInfo_paraVM);
        }
        public UnderlyingInfo_paraViewModel makeParameterInfoVM(FpmlSerializedCSharp.UnderlyingInformation xml_underInfo)
        {

            UnderlyingInfo_paraViewModel underInfoParaVM = new UnderlyingInfo_paraViewModel();

            ObservableCollection<Underlying_paraViewModel> underParaVMList = new ObservableCollection<Underlying_paraViewModel>();

            List<FpmlSerializedCSharp.Index> xml_indexList = xml_underInfo.IndexUnderInfo_.Index_;

            foreach (var item in xml_indexList)
	        {
		        underParaVMList.Add(this.makeIndexPara(item));
	        }

            // correlation 
            CorrelationInfo_paraViewModel corr_paraVM = this.makeCorrPara(xml_indexList);

            return underInfoParaVM;
        }
        private UnderlyingInfo_paraViewModel underInfo_paraVM(string itemCode)
        {
            UnderlyingInfo_paraViewModel underInfo_paraVM = new UnderlyingInfo_paraViewModel();

            QueryStr queryStr = new QueryStr(this.fileInfo_);

            queryStr.VariableMap_.Add("ITEM_CODE", itemCode);
            queryStr.VariableMap_.Add("STD_DATE", this.ReferenceDate_.ToString("yyyyMMdd"));

            conn_.addQuery("underInfo", queryStr.getQuery());

            conn_.excute();

            DataTable tb = conn_.ResultDataSet_.Tables["underInfo"];

            string krCode;
            string underName;
            string currentValue;
            string drift;
            string dividend;
            string volatility;

            List<string> underCode = new List<string>();

            foreach (DataRow item in tb.Rows)
            {
                krCode = item["STOCK_ID"].ToString();
                underName = item["STOCK_NAME"].ToString();
                currentValue = item["CURR_PRICE"].ToString();
                drift = ( Convert.ToDouble(item["RF"].ToString())/100 ).ToString();
                dividend = (Convert.ToDouble(item["DIVIDEND_RATE"].ToString()) / 100).ToString();
                volatility = (Convert.ToDouble(item["VOL"].ToString()) / 100).ToString();

                underCode.Add(krCode);

                GeometricBMViewModel gbmVM = this.makeGBM(krCode, underName, currentValue, drift, dividend, volatility);

                underInfo_paraVM.Underlying_paraViewModel_.Add(gbmVM);
            }

            underInfo_paraVM.CorrelationInfo_paraViewModel_ = this.makeCorrInfo(underCode);

            return underInfo_paraVM;
        }
 //fundCode 며 , book 이며 , 상품 code 며 이런거 받아야함
 //아.. 이게 따로 댈라나.... ㅡ.ㅡ;;
 
 public void loadData(UnderlyingInfo_paraViewModel underInfoParaVM)
 {
     //underInfoParaVM.
 }
        // ----------------------------------------------------------------------
        // 데이터를 로드하고, 기본 골격을 잡는 곳
        // ----------------------------------------------------------------------

        public override void initializeParameter(InstrumentViewModel instrumentViewModel)
        {
            StandardInstViewModel standInstVM = instrumentViewModel as StandardInstViewModel;
            IndexUnderInfoViewModel indexUnderInfoVM = standInstVM.UnderlyingViewModel_ as IndexUnderInfoViewModel;

            this.calculationAmountViewModel_ = new CalculationAmountViewModel();

            this.underlyingInfo_paraViewModel_ = new UnderlyingInfo_paraViewModel();
            this.underlyingInfo_paraViewModel_.initializeParameter(indexUnderInfoVM);

            this.discountCurve_paraViewModel_ = new DiscountCurve_paraViewModel();


            this.view_ = new Standard_paraView();
            this.view_.DataContext = this;

        }
        //fundCode 며 , book 이며 , 상품 code 며 이런거 받아야함
        //아.. 이게 따로 댈라나.... ㅡ.ㅡ;;

        public void loadData(UnderlyingInfo_paraViewModel underInfoParaVM)
        {
            //underInfoParaVM.
        }