29 const Date& valueDate,
30 const Date& maturityDate,
33 : overnightIndex_(
std::move(overnightIndex)), valueDate_(valueDate),
34 maturityDate_(maturityDate), convexityAdjustment_(
std::move(convexityAdjustment)),
35 averagingMethod_(averagingMethod) {
57 fwd = forwardCurve->forwardRate(d1, d2, dayCounter,
Simple).rate();
76 today = calendar.
adjust(today);
93 forwardDiscount /= forwardCurve->discount(
valueDate_);
95 prod /= forwardDiscount;
123 NPV_ = 100.0 * (1.0 - R);
Date adjust(const Date &, BusinessDayConvention convention=Following) const
Date advance(const Date &, Integer n, TimeUnit unit, BusinessDayConvention convention=Following, bool endOfMonth=false) const
Time yearFraction(const Date &, const Date &, const Date &refPeriodStart=Date(), const Date &refPeriodEnd=Date()) const
Returns the period between two dates as a fraction of year.
virtual bool hasOccurred(const Date &refDate=Date(), ext::optional< bool > includeRefDate=ext::nullopt) const
returns true if an event has already occurred before a date
Shared handle to an observable.
const TimeSeries< Real > & getHistory(const std::string &name) const
returns the (possibly empty) history of the index fixings
template class providing a null value for a given type.
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
ext::shared_ptr< OvernightIndex > overnightIndex_
void performCalculations() const override
Handle< Quote > convexityAdjustment_
bool isExpired() const override
returns whether the instrument might have value greater than zero.
Real compoundedRate() const
RateAveraging::Type averagingMethod_
Real averagedRate() const
OvernightIndexFuture(ext::shared_ptr< OvernightIndex > overnightIndex, const Date &valueDate, const Date &maturityDate, Handle< Quote > convexityAdjustment=Handle< Quote >(), RateAveraging::Type averagingMethod=RateAveraging::Compound)
Real convexityAdjustment() const
DateProxy & evaluationDate()
the date at which pricing is to be performed.
static Settings & instance()
access to the unique instance
Container for historical data.
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
#define QL_FAIL(message)
throw an error (possibly with file and line information)
Base class for events associated with a given date.
Real DiscountFactor
discount factor between dates
QL_INTEGER Integer
integer number
global repository for past index fixings
Array prod(const SparseMatrix &A, const Array &x)
ext::shared_ptr< YieldTermStructure > r