private void setting() { #region GBM GBMParameter gbm_kospi200 = new GBMParameter() { Name_ = "KOSPI200", Initial_ = 260, Drift_ = 0.015, Vol_ = 0.14 }; GBMParameter gbm1 = new GBMParameter() { Name_ = "Test_Index_1", Initial_ = 1000, Drift_ = 0.025, Vol_ = 0.3 }; GBMParameter gbm2 = new GBMParameter() { Name_ = "Test_Index_2", Initial_ = 250, Drift_ = 0.01, Vol_ = 0.15 }; GBMParameter gbm3 = new GBMParameter() { Name_ = "Test_Stock_1", Initial_ = 50000, Drift_ = 0.02, Vol_ = 0.4 }; GBMParameter gbm4 = new GBMParameter() { Name_ = "Test_Stock_2", Initial_ = 1000000, Drift_ = 0.025, Vol_ = 0.2 }; this.sampleIndex_.Add(gbm_kospi200); this.sampleIndex_.Add(gbm1); this.sampleIndex_.Add(gbm2); this.sampleIndex_.Add(gbm3); this.sampleIndex_.Add(gbm4); #endregion #region Vasicek VasicekParameter vas1 = new VasicekParameter() { Name_ = "Test_IR_1", Initial_ = 0.01, LongTermRate_ = 0.03, Speed_ = 0.1, Vol_ = 0.01 }; VasicekParameter vas2 = new VasicekParameter() { Name_ = "Test_IR_2", Initial_ = 0.02, LongTermRate_ = 0.03, Speed_ = 0.15, Vol_ = 0.015 }; VasicekParameter vas3 = new VasicekParameter() { Name_ = "Test_VOL_1", Initial_ = 0.03, LongTermRate_ = 0.05, Speed_ = 0.2, Vol_ = 0.02 }; VasicekParameter vas4 = new VasicekParameter() { Name_ = "Test_VOL_2", Initial_ = 0.04, LongTermRate_ = 0.05, Speed_ = 0.25, Vol_ = 0.025 }; this.sampleIR_.Add(vas1); this.sampleIR_.Add(vas2); this.sampleIR_.Add(vas3); this.sampleIR_.Add(vas4); #endregion #region Curve List<string> baseTenor = new List<string>() {"1M","3M","6M","1Y","2Y","3Y","4Y","5Y","7Y","10Y","20Y"}; List<double> initialCurve = new List<double>() {0.02,0.021,0.022,0.023,0.024,0.025,0.026,0.027,0.028,0.029,0.030}; CurveDefInfo cdi1 = new CurveDefInfo() { InitialCurve_ = initialCurve, Name_ = "IRSKRW", Tenor_ = baseTenor }; this.sampleCurve_.Add(cdi1); #endregion }
public void curveData(CurveDefInfo curveDefInfo, CurveShift curveShift, DateTime preDate, DateTime nextDate) { clsHDAT_CURVEDATA_TB clstb = new clsHDAT_CURVEDATA_TB(); //clstb.CURVE_CD = curveDefInfo.Name_; //DataTable tb = clstb.Select(); int seq = 1; clstb.REF_DT = nextDate.ToString("yyyyMMdd"); clstb.CURVE_CD = curveDefInfo.Name_; for (int i = 0; i < curveDefInfo.Tenor_.Count; i++) { clstb.TENOR = curveDefInfo.Tenor_[i]; clstb.TENOR_SEQ = seq; clstb.RATE = curveDefInfo.InitialCurve_[i]; clstb.RATE_TYP = (int)clsHDAT_CURVEDATA_TB.RATE_TYP_Type.SWAP; seq += 1; clstb.Insert(); } }