Skip to content

Commit

Permalink
[#1215] Refer to github issue
Browse files Browse the repository at this point in the history
Futures with monthly frequency use averaging rate, while with quarterly frequency use compouding. The constructor taking the averaging method explicitly can be deprecated.
  • Loading branch information
azsrz committed Nov 14, 2021
1 parent 2344bea commit b780ed7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ql/termstructures/yield/overnightindexfutureratehelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,15 @@ namespace QuantLib {
Frequency referenceFreq,
const ext::shared_ptr<OvernightIndex>& overnightIndex,
const Handle<Quote>& convexityAdjustment,
[[deprecated("infer averaging method from frequency")]]
RateAveraging::Type averagingMethod)
: OvernightIndexFutureRateHelper(price,
getValidSofrStart(referenceMonth, referenceYear, referenceFreq),
getValidSofrEnd(referenceMonth, referenceYear, referenceFreq),
overnightIndex,
convexityAdjustment,
averagingMethod) {
//averagingMethod
referenceFreq == Quarterly? RateAveraging::Compound : RateAveraging::Simple) {
QL_REQUIRE(referenceFreq == Quarterly || referenceFreq == Monthly,
"only monthly and quarterly SOFR futures accepted");
if (referenceFreq == Quarterly) {
Expand All @@ -122,14 +124,16 @@ namespace QuantLib {
Frequency referenceFreq,
const ext::shared_ptr<OvernightIndex>& overnightIndex,
Real convexityAdjustment,
[[deprecated("infer averaging method from frequency")]]
RateAveraging::Type averagingMethod)
: OvernightIndexFutureRateHelper(
Handle<Quote>(ext::make_shared<SimpleQuote>(price)),
getValidSofrStart(referenceMonth, referenceYear, referenceFreq),
getValidSofrEnd(referenceMonth, referenceYear, referenceFreq),
overnightIndex,
Handle<Quote>(ext::make_shared<SimpleQuote>(convexityAdjustment)),
averagingMethod) {
//averagingMethod
referenceFreq == Quarterly ? RateAveraging::Compound : RateAveraging::Simple) {
QL_REQUIRE(referenceFreq == Quarterly || referenceFreq == Monthly,
"only monthly and quarterly SOFR futures accepted");
if (referenceFreq == Quarterly) {
Expand Down
2 changes: 2 additions & 0 deletions ql/termstructures/yield/overnightindexfutureratehelper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,15 @@ namespace QuantLib {
Frequency referenceFreq,
const ext::shared_ptr<OvernightIndex>& overnightIndex,
const Handle<Quote>& convexityAdjustment = Handle<Quote>(),
[[deprecated("infer averaging method from frequency")]]
RateAveraging::Type averagingMethod = RateAveraging::Compound);
SofrFutureRateHelper(Real price,
Month referenceMonth,
Year referenceYear,
Frequency referenceFreq,
const ext::shared_ptr<OvernightIndex>& overnightIndex,
Real convexityAdjustment = 0,
[[deprecated("infer averaging method from frequency")]]
RateAveraging::Type averagingMethod = RateAveraging::Compound);
};

Expand Down

0 comments on commit b780ed7

Please sign in to comment.