//------------------------------------------------------------------------- public virtual double rate(OvernightCompoundedRateComputation computation, LocalDate startDate, LocalDate endDate, RatesProvider provider) { OvernightIndexRates rates = provider.overnightIndexRates(computation.Index); ObservationDetails details = new ObservationDetails(computation, rates); return(details.calculateRate()); }
//------------------------------------------------------------------------- public virtual double rate(OvernightAveragedRateComputation computation, LocalDate startDate, LocalDate endDate, RatesProvider provider) { OvernightIndexRates rates = provider.overnightIndexRates(computation.Index); LocalDate valuationDate = rates.ValuationDate; LocalDate startFixingDate = computation.StartDate; LocalDate startPublicationDate = computation.calculatePublicationFromFixing(startFixingDate); // No fixing to analyze. Go directly to approximation and cut-off. if (valuationDate.isBefore(startPublicationDate)) { return(rateForward(computation, rates)); } ObservationDetails details = new ObservationDetails(computation, rates); return(details.calculateRate()); }