예제 #1
0
        private void yieldTestBtn_Click(object sender, RoutedEventArgs e)
        {
            //Excel_irCurveSymbolViewModel test = new Excel_irCurveSymbolViewModel();

            //test.Symbol_ = "111000";

            //DataBaseConnectManager.DBConnection_
            //    = DataBaseConnectManager.ConnectionFactory(EnvironmentVariable.MarketDataDBFile_,"RMS");

            //test.dataLoad(new DateTime(2014, 10, 24));

            CurveManager cm = new CurveManager();

            cm.load("111000", ProgramVariable.ReferenceDate_);

            //QLNet.YieldTermStructure ts = cm.yieldTS();
            QLNet.YieldTermStructure ts = cm.yieldTSBuild();

            double[] sumY = Enumerable.Repeat <double>(0.0, 100).ToArray <double>();
            double[] x    = Enumerable.Range(0, 200).Select(i => i / 100.0).ToArray();
            double[] y    = new double[x.Length];

            for (int i = 0; i < x.Length; i++)
            {
                y[i] = ts.zeroRate(x[i], QLNet.Compounding.Compounded).value();
            }

            ChartPlotter cp = new ChartPlotter();

            var xData = x.AsXDataSource();
            var yData = y.AsYDataSource();

            CompositeDataSource compositeDataSource = xData.Join(yData);

            LineGraph lineG = new LineGraph(compositeDataSource);

            lineG.Description = new PenDescription("합계");
            cp.Children.Add(lineG);

            //this.chartGrid_.Children.Add(cp);

            Window w = new Window();

            w.Content = cp;
            w.ShowDialog();
        }
예제 #2
0
        public void addEvalCurve(string index_cd) 
        {
            QLNet.YieldTermStructure ql_curve = new QLNet.YieldTermStructure();

            clsITEM_INDEX_CURVE_MAP_TB clstb = new clsITEM_INDEX_CURVE_MAP_TB();

            clstb.INDEX_CD = index_cd;

            clstb.SelectOwn();

            string curve_cd = clstb.CURVE_CD;

            // ql _ yield curve build

            this.EvalCurveMap_.Add(index_cd, ql_curve);

        }