public void loadDataFromExcelSheet(Excel.Worksheet activeWorksheet) { this.callOptionViewModelList_.Clear(); this.putOptionViewModelList_.Clear(); this.call_strikeData_.Clear(); this.put_strikeData_.Clear(); this.call_imvolData_.Clear(); this.put_imvolData_.Clear(); Excel.Range rngColumnA = activeWorksheet.get_Range("A1:A300"); try { Excel.Range callNameRng = rngColumnA.Find("콜옵션 종목명"); Excel.Range callDataRng = callNameRng.CurrentRegion; int callOptionCount = callDataRng.Rows.Count; OptionViewModel sumCallOVM = new OptionViewModel(); for (int i = 1; i < callOptionCount; i++) { OPTION_POSITION_Table_DAO dao = new OPTION_POSITION_Table_DAO(); dao.POSITIONNAME_ = (string)callNameRng.get_Offset(i, 0).Value; dao.CURRPRICE_ = (callNameRng.get_Offset(i, 1).Value2).ToString(); dao.PREDIFF_ = (callNameRng.get_Offset(i, 2).Value2).ToString(); dao.PREDIFFRATE_ = (callNameRng.get_Offset(i, 3).Value2).ToString(); dao.CURRPRICE2_ = (callNameRng.get_Offset(i, 4).Value2).ToString(); dao.PREDIFF2_ = (callNameRng.get_Offset(i, 5).Value2).ToString(); dao.PREDIFFRATE2_ = (callNameRng.get_Offset(i, 6).Value2).ToString(); dao.TRADINGAMT_ = (callNameRng.get_Offset(i, 7).Value2).ToString(); dao.IMVOL_ = (callNameRng.get_Offset(i, 8).Value2).ToString(); dao.GREEK_DELTA_ = (callNameRng.get_Offset(i, 9).Value2).ToString(); dao.GREEK_GAMMA_ = (callNameRng.get_Offset(i, 10).Value2).ToString(); dao.GREEK_VEGA_ = (callNameRng.get_Offset(i, 11).Value2).ToString(); dao.GREEK_THETA_ = (callNameRng.get_Offset(i, 12).Value2).ToString(); dao.GREEK_RHO_ = (callNameRng.get_Offset(i, 13).Value2).ToString(); dao.TRADINGVALUE_ = (callNameRng.get_Offset(i, 14).Value2).ToString(); dao.REMAINAMT_ = (callNameRng.get_Offset(i, 15).Value2).ToString(); dao.REMAINAMTPREDIFF_ = (callNameRng.get_Offset(i, 16).Value2).ToString(); OptionViewModel ovm = new OptionViewModel(); ovm.build(dao); if (ovm.ImVol_ > 5) { if (!(this.call_strikeData_.Contains(ovm.Strike_))) { this.call_strikeData_.Add(ovm.Strike_); this.call_imvolData_.Add(ovm.ImVol_); } } this.callOptionViewModelList_.Add(ovm); } Excel.Range putNameRng = rngColumnA.Find("풋옵션 종목명"); Excel.Range putDataRng = callNameRng.CurrentRegion; int putOptionCount = putDataRng.Rows.Count; for (int i = 1; i < putOptionCount; i++) { OPTION_POSITION_Table_DAO dao = new OPTION_POSITION_Table_DAO(); dao.POSITIONNAME_ = (string)putNameRng.get_Offset(i, 0).Value; dao.CURRPRICE_ = (putNameRng.get_Offset(i, 1).Value2).ToString(); dao.PREDIFF_ = (putNameRng.get_Offset(i, 2).Value2).ToString(); dao.PREDIFFRATE_ = (putNameRng.get_Offset(i, 3).Value2).ToString(); dao.CURRPRICE2_ = (putNameRng.get_Offset(i, 4).Value2).ToString(); dao.PREDIFF2_ = (putNameRng.get_Offset(i, 5).Value2).ToString(); dao.PREDIFFRATE2_ = (putNameRng.get_Offset(i, 6).Value2).ToString(); dao.TRADINGAMT_ = (putNameRng.get_Offset(i, 7).Value2).ToString(); dao.IMVOL_ = (putNameRng.get_Offset(i, 8).Value2).ToString(); dao.GREEK_DELTA_ = (putNameRng.get_Offset(i, 9).Value2).ToString(); dao.GREEK_GAMMA_ = (putNameRng.get_Offset(i, 10).Value2).ToString(); dao.GREEK_VEGA_ = (putNameRng.get_Offset(i, 11).Value2).ToString(); dao.GREEK_THETA_ = (putNameRng.get_Offset(i, 12).Value2).ToString(); dao.GREEK_RHO_ = (putNameRng.get_Offset(i, 13).Value2).ToString(); dao.TRADINGVALUE_ = (putNameRng.get_Offset(i, 14).Value2).ToString(); dao.REMAINAMT_ = (putNameRng.get_Offset(i, 15).Value2).ToString(); dao.REMAINAMTPREDIFF_ = (putNameRng.get_Offset(i, 16).Value2).ToString(); OptionViewModel ovm = new OptionViewModel(); ovm.build(dao); if (ovm.ImVol_ > 5) { if (!(this.put_strikeData_.Contains(ovm.Strike_))) { this.put_strikeData_.Add(ovm.Strike_); this.put_imvolData_.Add(ovm.ImVol_); } } this.putOptionViewModelList_.Add(ovm); } this.gbmParaViewModel_.CurrentPrice_ = (this.call_strikeData_[0] + this.call_strikeData_[this.call_strikeData_.Count - 1]) / 2; this.call_strikeData_.Reverse(); this.call_imvolData_.Reverse(); this.put_strikeData_.Reverse(); this.put_imvolData_.Reverse(); this.gbmParaViewModel_.Call_Interpolation_ = this.call_imvolFitting(); this.gbmParaViewModel_.Put_Interpolation_ = this.put_imvolFitting(); } catch (Exception) { System.Windows.MessageBox.Show("Load PowerBase TR_8586 Data."); throw; } }