19#include <ql/event.hpp>
29 QuantLib::Position::Type position, QuantLib::Real quantity,
30 const QuantLib::Date& maturityDate, QuantLib::Real strike,
bool physicallySettled,
31 const Date& paymentDate,
const QuantLib::Currency& payCcy,
const Date& fixingDate,
32 const QuantLib::ext::shared_ptr<QuantExt::FxIndex>& fxIndex)
33 : index_(index), currency_(currency), position_(position), quantity_(quantity), maturityDate_(maturityDate),
34 strike_(strike), physicallySettled_(physicallySettled), paymentDate_(paymentDate), payCcy_(payCcy),
35 fxIndex_(fxIndex), fixingDate_(fixingDate) {
37 QL_REQUIRE(
quantity_ > 0,
"Commodity forward quantity should be positive: " <<
quantity);
42 ") should not be provided for physically settled commodity forwards.");
47 ") for a cash settled commodity forward should be on or after the maturity date (" <<
53 "CommodityNonDeliverableForward: payment date ("
54 << io::iso_date(
paymentDate_) <<
") for a commodity NDF should be on or after the fixing date ("
71 QL_REQUIRE(
arguments !=
nullptr,
"wrong argument type in CommodityForward");
QuantLib::Date maturityDate
QuantLib::Position::Type position
QuantLib::ext::shared_ptr< FxIndex > fxIndex
QuantLib::ext::shared_ptr< CommodityIndex > index
QuantLib::Date paymentDate
QuantLib::Currency currency
void validate() const override
CommodityForward(const QuantLib::ext::shared_ptr< CommodityIndex > &index, const QuantLib::Currency ¤cy, QuantLib::Position::Type position, QuantLib::Real quantity, const QuantLib::Date &maturityDate, QuantLib::Real strike, bool physicallySettled=true, const Date &paymentDate=Date(), const QuantLib::Currency &payCcy=Currency(), const Date &fixingDate=Date(), const QuantLib::ext::shared_ptr< QuantExt::FxIndex > &fxIndex=nullptr)
QuantLib::ext::shared_ptr< FxIndex > fxIndex_
bool isExpired() const override
QuantLib::Currency currency_
QuantLib::Date paymentDate_
QuantLib::ext::shared_ptr< CommodityIndex > index_
void setupArguments(QuantLib::PricingEngine::arguments *) const override
QuantLib::Real quantity() const
QuantLib::Position::Type position_
QuantLib::Date maturityDate_
QuantLib::Real strike() const
Instrument representing a commodity forward contract.
Filter close_enough(const RandomVariable &x, const RandomVariable &y)