private static UnderlyingAsset CreateSimpleIRSwap(string marketInstrumentId) { var simpleIRSwap = new SimpleIRSwap(); string[] slicedInstrumentId = marketInstrumentId.Split('-'); string instrumentCurrency = slicedInstrumentId[0]; string instrumentTerm = slicedInstrumentId[2]; simpleIRSwap.currency = new IdentifiedCurrency { Value = instrumentCurrency }; simpleIRSwap.term = PeriodHelper.Parse(instrumentTerm); simpleIRSwap.instrumentId = new[] { new InstrumentId() }; simpleIRSwap.instrumentId[0].Value = marketInstrumentId; return(simpleIRSwap); }
public static RateIndex Parse(string instrumentId, string floatingRateIndex, string currency, string dayCountFraction, string paymentFrequency, string term) { var rateIndex = new RateIndex { currency = new IdentifiedCurrency() { Value = currency }, dayCountFraction = DayCountFractionHelper.Parse(dayCountFraction), floatingRateIndex = FloatingRateIndexHelper.Parse(floatingRateIndex), id = instrumentId, instrumentId = InstrumentIdArrayHelper.Parse(instrumentId), paymentFrequency = PeriodHelper.Parse(paymentFrequency), term = PeriodHelper.Parse(term) }; return(rateIndex); }
public static Period FromYears(int years) { return(PeriodHelper.Parse(years + "Y")); }
public static Period FromMonths(int months) { return(PeriodHelper.Parse(months + "M")); }
public static Period FromWeeks(int weeks) { return(PeriodHelper.Parse(weeks + "W")); }
public static Period FromDays(int days) { return(PeriodHelper.Parse(days + "D")); }