Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to latest quantlib #30

Open
wants to merge 7 commits into
base: v1.23.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 0 additions & 65 deletions QuantLibAddin/gensrc/metadata/functions/bonds.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1477,71 +1477,6 @@
</ParameterList>
</Constructor>

<Constructor name='qlFixedRateBond2'>
<libraryFunction>FixedRateBond</libraryFunction>
<SupportedPlatforms>
<!--SupportedPlatform name='Excel' calcInWizard='false'/-->
<SupportedPlatform name='Excel'/>
<SupportedPlatform name='Calc'/>
<SupportedPlatform name='Cpp'/>
</SupportedPlatforms>
<ParameterList>
<Parameters>
<Parameter name='Description' default='std::string()'>
<type>string</type>
<tensorRank>scalar</tensorRank>
<description>Bond description string. Autogenerated if null</description>
</Parameter>
<Parameter name='Currency' examplevalue='EUR'>
<type>QuantLib::Currency</type>
<tensorRank>scalar</tensorRank>
<description>bond Currency.</description>
</Parameter>
<Parameter name='SettlementDays' exampleValue='3'>
<type>QuantLib::Size</type>
<tensorRank>scalar</tensorRank>
<description>settlement days.</description>
</Parameter>
<Parameter name='FaceAmount' default='100.0'>
<type>QuantLib::Real</type>
<tensorRank>scalar</tensorRank>
<description>Face nominal amount.</description>
</Parameter>
<Parameter name='ScheduleID'>
<type>QuantLib::Schedule</type>
<superType>libraryClass</superType>
<tensorRank>scalar</tensorRank>
<description>Schedule object ID.</description>
</Parameter>
<Parameter name='Coupons'>
<type>QuantLib::InterestRate</type>
<tensorRank>vector</tensorRank>
<description>coupon InterestRate IDs.</description>
</Parameter>
<Parameter name='PaymentBDC' default='"Following"'>
<type>QuantLib::BusinessDayConvention</type>
<tensorRank>scalar</tensorRank>
<description>payment business day convention.</description>
</Parameter>
<Parameter name='Redemption' default='100.0'>
<type>QuantLib::Real</type>
<tensorRank>scalar</tensorRank>
<description>Redemption value.</description>
</Parameter>
<Parameter name='IssueDate' default='QuantLib::Date()'>
<type>QuantLib::Date</type>
<tensorRank>scalar</tensorRank>
<description>issue date: the bond can't be traded until then.</description>
</Parameter>
<Parameter name='PaymentCalendar' exampleValue='TARGET'>
<type>QuantLib::Calendar</type>
<tensorRank>scalar</tensorRank>
<description>payment holiday calendar (e.g. TARGET).</description>
</Parameter>
</Parameters>
</ParameterList>
</Constructor>

<Constructor name='qlFloatingRateBond'>
<libraryFunction>FloatingRateBond</libraryFunction>
<SupportedPlatforms>
Expand Down
75 changes: 0 additions & 75 deletions QuantLibAddin/gensrc/metadata/functions/credit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -520,81 +520,6 @@
</ParameterList>
</Constructor>

<Constructor name='qlRiskyFixedBond'>
<libraryFunction>RiskyFixedBond</libraryFunction>
<SupportedPlatforms>
<!--SupportedPlatform name='Excel' calcInWizard='false'/-->
<SupportedPlatform name='Excel'/>
<SupportedPlatform name='Calc'/>
<SupportedPlatform name='Cpp'/>
</SupportedPlatforms>
<ParameterList>
<Parameters>
<Parameter name='Bondname'>
<type>string</type>
<tensorRank>scalar</tensorRank>
<description>Bonds id.</description>
</Parameter>
<Parameter name='Currency'>
<type>QuantLib::Currency</type>
<tensorRank>scalar</tensorRank>
<description>Curency of the reference bond affected.</description>
</Parameter>
<Parameter name='Recovery'>
<type>double</type>
<tensorRank>scalar</tensorRank>
<description>Recovery Rate.</description>
</Parameter>

<Parameter name='DefaultCurve'>
<type>QuantLib::DefaultProbabilityTermStructure</type>
<superType>libToHandle</superType>
<tensorRank>scalar</tensorRank>
<description>default term structure object ID.</description>
</Parameter>

<Parameter name='Schedule'>
<type>QuantLib::Schedule</type>
<superType>libraryClass</superType>
<tensorRank>scalar</tensorRank>
<description>Schedule.</description>
</Parameter>
<Parameter name='Rate'>
<type>QuantLib::Rate</type>
<tensorRank>scalar</tensorRank>
<description>Rate.</description>
</Parameter>
<Parameter name='DayCounter' exampleValue='Actual/360'>
<type>QuantLib::DayCounter</type>
<tensorRank>scalar</tensorRank>
<description>premium leg day counter (e.g. Actual/360).</description>
</Parameter>
<Parameter name='PaymentConvention' default='"Following"'>
<type>QuantLib::BusinessDayConvention</type>
<tensorRank>scalar</tensorRank>
<description>Payment dates' business day convention.</description>
</Parameter>
<Parameter name='Notional'>
<type>double</type>
<tensorRank>scalar</tensorRank>
<description>Notional.</description>
</Parameter>
<Parameter name='DiscountingCurve'>
<type>QuantLib::YieldTermStructure</type>
<superType>libToHandle</superType>
<tensorRank>scalar</tensorRank>
<description>discounting YieldTermStructure object ID.</description>
</Parameter>
<Parameter name='PricingDate'>
<type>QuantLib::Date</type>
<tensorRank>scalar</tensorRank>
<description>desired npv date.</description>
</Parameter>

</Parameters>
</ParameterList>
</Constructor>

<!-- Limited by now to one curve/event_type pair and one default event-->
<Constructor name='qlIssuer'>
<libraryFunction>Issuer</libraryFunction>
Expand Down
24 changes: 4 additions & 20 deletions QuantLibAddin/gensrc/metadata/functions/forwardrateagreement.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
</ParameterList>
</Constructor>

<Member name='qlFRAforwardRate' type='QuantLib::ForwardRateAgreement'>
<Member name='qlFraForwardRate' type='QuantLib::ForwardRateAgreement'>
<description>Returns the relevant forward rate associated with the FRA term.</description>
<libraryFunction>forwardRate</libraryFunction>
<SupportedPlatforms>
Expand All @@ -87,25 +87,9 @@
</ReturnValue>
</Member>

<Member name='qlFRAforwardValue' type='QuantLib::ForwardRateAgreement'>
<description>Returns the forward value of the FRA.</description>
<libraryFunction>forwardValue</libraryFunction>
<SupportedPlatforms>
<SupportedPlatform name='Excel'/>
<!--SupportedPlatform name='Cpp'/-->
</SupportedPlatforms>
<ParameterList>
<Parameters/>
</ParameterList>
<ReturnValue>
<type>double</type>
<tensorRank>scalar</tensorRank>
</ReturnValue>
</Member>

<Member name='qlFRAspotValue' type='QuantLib::ForwardRateAgreement'>
<description>Returns the spot value of the FRA.</description>
<libraryFunction>spotValue</libraryFunction>
<Member name='qlFraAmount' type='QuantLib::ForwardRateAgreement'>
<description>Returns the payoff of the FRA on the value date.</description>
<libraryFunction>amount</libraryFunction>
<SupportedPlatforms>
<SupportedPlatform name='Excel'/>
<!--SupportedPlatform name='Cpp'/-->
Expand Down
33 changes: 33 additions & 0 deletions QuantLibAddin/gensrc/metadata/functions/pricingengines.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<include>qlo/processes.hpp</include>
<include>ql/pricingengines/blackformula.hpp</include>
<include>ql/pricingengines/blackscholescalculator.hpp</include>
<include>ql/termstructures/defaulttermstructure.hpp</include>
<include>ql/termstructures/volatility/optionlet/optionletvolatilitystructure.hpp</include>
<include>ql/termstructures/volatility/swaption/swaptionvolstructure.hpp</include>
<include>ql/pricingengines/swaption/jamshidianswaptionengine.hpp</include>
Expand All @@ -26,6 +27,7 @@
<include>qlo/processes.hpp</include>
<include>ql/pricingengines/blackformula.hpp</include>
<include>ql/pricingengines/blackscholescalculator.hpp</include>
<include>ql/termstructures/defaulttermstructure.hpp</include>
<include>ql/termstructures/volatility/optionlet/optionletvolatilitystructure.hpp</include>
<include>ql/termstructures/volatility/swaption/swaptionvolstructure.hpp</include>
<include>ql/pricingengines/swaption/jamshidianswaptionengine.hpp</include>
Expand Down Expand Up @@ -1549,6 +1551,37 @@
</ParameterList>
</Constructor>

<Constructor name='qlRiskyBondEngine'>
<libraryFunction>RiskyBondEngine</libraryFunction>
<SupportedPlatforms>
<!--SupportedPlatform name='Excel' calcInWizard='false'/-->
<SupportedPlatform name='Excel'/>
<SupportedPlatform name='Calc'/>
<SupportedPlatform name='Cpp'/>
</SupportedPlatforms>
<ParameterList>
<Parameters>
<Parameter name='DefaultCurve'>
<type>QuantLib::DefaultProbabilityTermStructure</type>
<superType>libToHandle</superType>
<tensorRank>scalar</tensorRank>
<description>default term structure object ID.</description>
</Parameter>
<Parameter name='Recovery'>
<type>double</type>
<tensorRank>scalar</tensorRank>
<description>Recovery Rate.</description>
</Parameter>
<Parameter name='DiscountingCurve'>
<type>QuantLib::YieldTermStructure</type>
<superType>libToHandle</superType>
<tensorRank>scalar</tensorRank>
<description>discounting YieldTermStructure object ID.</description>
</Parameter>
</Parameters>
</ParameterList>
</Constructor>

<Constructor name='qlJamshidianSwaptionEngine'>
<libraryFunction>JamshidianSwaptionEngine</libraryFunction>
<SupportedPlatforms>
Expand Down
3 changes: 2 additions & 1 deletion QuantLibAddin/gensrc/qlgensrc.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
<None Include="metadata\functions\cmsmarket.xml" />
<None Include="metadata\functions\cmsmarketcalibration.xml" />
<None Include="metadata\functions\couponvectors.xml" />
<None Include="metadata\functions\credit.xml" />
<None Include="metadata\functions\date.xml" />
<None Include="metadata\functions\daycounter.xml" />
<None Include="metadata\functions\defaultbasket.xml" />
Expand Down Expand Up @@ -171,4 +172,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
5 changes: 4 additions & 1 deletion QuantLibAddin/gensrc/qlgensrc.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
<None Include="metadata\functions\couponvectors.xml">
<Filter>functions</Filter>
</None>
<None Include="metadata\functions\credit.xml">
<Filter>functions</Filter>
</None>
<None Include="metadata\functions\date.xml">
<Filter>functions</Filter>
</None>
Expand Down Expand Up @@ -328,4 +331,4 @@
<Filter>functions</Filter>
</Xml>
</ItemGroup>
</Project>
</Project>
41 changes: 0 additions & 41 deletions QuantLibAddin/qlo/bonds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,47 +207,6 @@ namespace QuantLibAddin {
}
}

FixedRateBond::FixedRateBond(
const shared_ptr<ObjectHandler::ValueObject>& properties,
const string& des,
const QuantLib::Currency& cur,
QuantLib::Natural settlementDays,
QuantLib::Real faceAmount,
const shared_ptr<QuantLib::Schedule>& schedule,
const vector<shared_ptr<QuantLib::InterestRate> >& coupons,
QuantLib::BusinessDayConvention paymentConvention,
QuantLib::Real redemption,
const Date& issueDate,
const QuantLib::Calendar& paymentCalendar,
bool permanent)
: Bond(properties, des, cur, permanent)
{
vector<QuantLib::InterestRate> couponRate(coupons.size());

for (Size i=0; i<coupons.size(); ++i)
couponRate[i] = *coupons[i];

qlBondObject_ = shared_ptr<QuantLib::FixedRateBond>(new
QuantLib::FixedRateBond(settlementDays, faceAmount,
*schedule,
couponRate,
paymentConvention,
redemption,
issueDate,
paymentCalendar));
libraryObject_ = qlBondObject_;
if (description_.empty()) {
std::ostringstream temp;
temp << "FixedRateBond ";
temp << QuantLib::io::iso_date(qlBondObject_->maturityDate());
if (couponRate.size()==1)
temp << " " << coupons[0]->rate()*100.0 << "%";
else
temp << " STEP";
description_ = temp.str();
}
}

FixedRateBond::FixedRateBond(
const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
const std::string& des,
Expand Down
13 changes: 0 additions & 13 deletions QuantLibAddin/qlo/bonds.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,6 @@ namespace QuantLibAddin {
const QuantLib::Date& issueDate,
const QuantLib::Calendar& paymentCalendar,
bool permanent);
FixedRateBond(
const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
const std::string& des,
const QuantLib::Currency& cur,
QuantLib::Natural settlementDays,
QuantLib::Real faceAmount,
const boost::shared_ptr<QuantLib::Schedule>& schedule,
const std::vector<boost::shared_ptr<QuantLib::InterestRate> >& coupons,
QuantLib::BusinessDayConvention paymentConvention,
QuantLib::Real redemption,
const QuantLib::Date& issueDate,
const QuantLib::Calendar& paymentCalendar,
bool permanent);
protected:
FixedRateBond(
const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
Expand Down
30 changes: 0 additions & 30 deletions QuantLibAddin/qlo/credit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include <ql/math/interpolations/loginterpolation.hpp>
#include <ql/pricingengines/credit/midpointcdsengine.hpp>

#include <ql/experimental/credit/riskybond.hpp>
#include <ql/experimental/credit/syntheticcdo.hpp>
#include <ql/experimental/credit/midpointcdoengine.hpp>
#include <ql/experimental/credit/nthtodefault.hpp>
Expand Down Expand Up @@ -325,35 +324,6 @@ namespace QuantLibAddin {
QuantLib::PiecewiseYieldCurve<QuantLib::Discount,QuantLib::LogLinear>(referenceDate, helpers, dayCounter));
}



RiskyFixedBond::RiskyFixedBond(
const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
std::string name,
QuantLib::Currency ccy,
QuantLib::Real recoveryRate,
QuantLib::Handle<QuantLib::DefaultProbabilityTermStructure> defaultTS,
const boost::shared_ptr<QuantLib::Schedule>& schedule,
QuantLib::Real rate,
QuantLib::DayCounter dayCounter,
QuantLib::BusinessDayConvention paymentConvention,
QuantLib::Real notional,
QuantLib::Handle<QuantLib::YieldTermStructure> yieldTS,
QuantLib::Date npvDate, // unused by now
bool permanent)
: Instrument(properties, permanent) {

std::vector<QuantLib::Real> notionals(1,notional);

libraryObject_ = boost::shared_ptr<QuantLib::RiskyFixedBond>(
new QuantLib::RiskyFixedBond(
name,ccy,recoveryRate,defaultTS,*schedule,rate,dayCounter,
paymentConvention,notionals,yieldTS///, npvDate
));

}


SyntheticCDO::SyntheticCDO(
const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
const boost::shared_ptr<QuantLib::Basket>& bskt,
Expand Down
Loading