private static void testStructuredBondCalculation() { Excel_instrument_structuredBondViewModel inst = new Excel_instrument_structuredBondViewModel(); DateTime refDate = new DateTime(2014, 12, 10); inst.calculate("testInst", refDate); }
public string load_instrument(string itemCode) { try { Excel_instrumentViewModel e_i_hvm = MasterInformationViewModel.loadInstrumentVM(itemCode); //this.InstVM_ = new Excel_instrument_hifiveViewModel(); this.InstVM_ = e_i_hvm as Excel_instrument_structuredBondViewModel; if (this.InstVM_ == null) { throw new Exception("instrument is not structuredBond type"); } this.InstVM_.loadInterfaceVMFromXml(XMLFileLoader.LoadInstrument(itemCode)); // Excel_standardParaViewModel e_spvm = this.InstVM_.Excel_parameterViewModel_ as Excel_standardParaViewModel; // foreach (var item in InstVM_.Excel_interfaceViewModel_.Excel_underlyingCalcInfoViewModel_.Excel_underlyingInfoViewModel_) { Excel_underlyingInfo_paraViewModel e_u_pvm = new Excel_underlyingInfo_paraViewModel(); e_u_pvm.buildParaSetting(item); e_spvm.Excel_underlyingCalcInfo_paraViewModel_.Excel_underlyingInfo_paraViewModel_.Add(e_u_pvm); e_spvm.Excel_underlyingCalcInfo_paraViewModel_.Excel_correlationInfo_paraViewModel_.addDiagonal(e_u_pvm); } return("load complete"); } catch (Exception e) { return("load err : " + e.Message); } }
public Instrument_structuredBond() { this.InstVM_ = new Excel_instrument_structuredBondViewModel(true); }