21#include <boost/make_shared.hpp>
26using std::ostringstream;
39QuantLib::ext::shared_ptr<Trade>
buildSwap(
string id,
string ccy,
bool isPayer, Real notional,
int start, Size term, Real rate,
40 Real spread,
string fixedFreq,
string fixedDC,
string floatFreq,
string floatDC,
41 string index, Calendar cal = TARGET(),
42 QuantLib::Natural fixingDays = 2,
bool spotStartLag =
false);
44QuantLib::ext::shared_ptr<Trade>
buildEuropeanSwaption(
string id,
string longShort,
string ccy,
bool isPayer, Real notional,
45 int start, Size term, Real rate, Real spread,
string fixedFreq,
46 string fixedDC,
string floatFreq,
string floatDC,
string index,
47 string cashPhysical =
"Cash", Real premium = 0.0,
string premiumCcy =
"",
48 string premiumDate =
"");
50QuantLib::ext::shared_ptr<Trade>
buildBermudanSwaption(
string id,
string longShort,
string ccy,
bool isPayer, Real notional,
51 Size exercises,
int start, Size term, Real rate, Real spread,
52 string fixedFreq,
string fixedDC,
string floatFreq,
string floatDC,
53 string index,
string cashPhysical =
"Cash", Real premium = 0.0,
54 string premiumCcy =
"",
string premiumDate =
"");
56QuantLib::ext::shared_ptr<Trade>
buildFxOption(
string id,
string longShort,
string putCall, Size expiry,
string boughtCcy,
57 Real boughtAmount,
string soldCcy, Real soldAmount, Real premium = 0.0,
58 string premiumCcy =
"",
string premiumDate =
"");
60QuantLib::ext::shared_ptr<Trade>
buildEquityOption(
string id,
string longShort,
string putCall, Size expiry,
string equityName,
61 string currency, Real strike, Real quantity, Real premium = 0.0,
62 string premiumCcy =
"",
string premiumDate =
"");
64QuantLib::ext::shared_ptr<Trade>
buildEquityForward(
string id,
string longShort, Size expiry,
string equityName,
65 string currency, Real strike, Real quantity);
67QuantLib::ext::shared_ptr<Trade>
buildCap(
string id,
string ccy,
string longShort, Real capRate, Real notional,
int start,
68 Size term,
string floatFreq,
string floatDC,
string index,
69 Calendar cal = TARGET(), QuantLib::Natural fixingDays = 2,
70 bool spotStartLag =
false);
72QuantLib::ext::shared_ptr<Trade>
buildFloor(
string id,
string ccy,
string longShort, Real floorRate, Real notional,
int start,
73 Size term,
string floatFreq,
string floatDC,
string index,
74 Calendar cal = TARGET(), QuantLib::Natural fixingDays = 2,
75 bool spotStartLag =
false);
77QuantLib::ext::shared_ptr<Trade>
buildCapFloor(
string id,
string ccy,
string longShort, vector<Real> capRates,
78 vector<Real> floorRates, Real notional,
int start, Size term,
string floatFreq,
79 string floatDC,
string index,
80 Calendar cal = TARGET(), QuantLib::Natural fixingDays = 2,
81 bool spotStartLag =
false);
84 string id,
string recCcy, Real recNotional,
string payCcy, Real payNotional,
int start, Size term,
85 Real recLegSpread, Real payLegSpread,
string recFreq,
string recDC,
string recIndex, Calendar recCalendar,
86 string payFreq,
string payDC,
string payIndex, Calendar payCalendar, QuantLib::Natural spotDays = 2,
87 bool spotStartLag =
false,
bool notionalInitialExchange =
false,
bool notionalFinalExchange =
false,
88 bool notionalAmortizingExchange =
false,
bool isRecLegFXResettable =
false,
bool isPayLegFXResettable =
false);
90QuantLib::ext::shared_ptr<Trade>
buildZeroBond(
string id,
string ccy, Real notional, Size term,
string suffix =
"1");
92QuantLib::ext::shared_ptr<Trade>
buildCreditDefaultSwap(
string id,
string ccy,
string issuerId,
string creditCurveId,
93 bool isPayer, Real notional,
int start, Size term, Real rate,
94 Real spread,
string fixedFreq,
string fixedDC);
96QuantLib::ext::shared_ptr<Trade>
buildSyntheticCDO(
string id,
string name, vector<string> names,
string longShort,
97 string ccy, vector<string> ccys,
bool isPayer,
98 vector<Real> notionals, Real notional,
int start, Size term,
99 Real rate, Real spread,
string fixedFreq,
string fixedDC);
101QuantLib::ext::shared_ptr<Trade>
buildCmsCapFloor(
string id,
string ccy,
string indexId,
bool isPayer, Real notional,
102 int start, Size term, Real capRate, Real floorRate, Real spread,
103 string freq,
string dc);
105QuantLib::ext::shared_ptr<Trade>
buildCPIInflationSwap(
string id,
string ccy,
bool isPayer, Real notional,
int start, Size term,
106 Real spread,
string floatFreq,
string floatDC,
string index,
107 string cpiFreq,
string cpiDC,
string cpiIndex, Real baseRate,
108 string observationLag,
bool interpolated, Real cpiRate);
110QuantLib::ext::shared_ptr<Trade>
buildYYInflationSwap(
string id,
string ccy,
bool isPayer, Real notional,
int start, Size term,
111 Real spread,
string floatFreq,
string floatDC,
string index,
112 string yyFreq,
string yyDC,
string yyIndex,
string observationLag,
116 bool isLong, Real capFloorRate,
int start, Size term,
117 string yyFreq,
string yyDC,
string yyIndex,
118 string observationLag, Size fixDays);
120QuantLib::ext::shared_ptr<Trade>
buildCommodityForward(
const std::string&
id,
const std::string& position, Size term,
121 const std::string& commodityName,
const std::string& currency,
122 Real strike, Real quantity);
125 const std::string& putCall, QuantLib::Size term,
126 const std::string& commodityName,
const std::string& currency,
127 QuantLib::Real strike, QuantLib::Real quantity,
128 QuantLib::Real premium = 0.0,
const std::string& premiumCcy =
"",
129 const std::string& premiumDate =
"");
QuantLib::ext::shared_ptr< Trade > buildCreditDefaultSwap(string id, string ccy, string issuerId, string creditCurveId, bool isPayer, Real notional, int start, Size term, Real rate, Real spread, string fixedFreq, string fixedDC)
QuantLib::ext::shared_ptr< Trade > buildSyntheticCDO(string id, string name, vector< string > names, string longShort, string ccy, vector< string > ccys, bool isPayer, vector< Real > notionals, Real notional, int start, Size term, Real rate, Real spread, string fixedFreq, string fixedDC)
QuantLib::ext::shared_ptr< Trade > buildCap(string id, string ccy, string longShort, Real capRate, Real notional, int start, Size term, string floatFreq, string floatDC, string index, Calendar calendar, Natural spotDays, bool spotStartLag)
QuantLib::ext::shared_ptr< Trade > buildFxOption(string id, string longShort, string putCall, Size expiry, string boughtCcy, Real boughtAmount, string soldCcy, Real soldAmount, Real premium, string premiumCcy, string premiumDate)
QuantLib::ext::shared_ptr< Trade > buildCmsCapFloor(string id, string ccy, string indexId, bool isPayer, Real notional, int start, Size term, Real capRate, Real floorRate, Real spread, string freq, string dc)
QuantLib::ext::shared_ptr< Trade > buildSwap(string id, string ccy, bool isPayer, Real notional, int start, Size term, Real rate, Real spread, string fixedFreq, string fixedDC, string floatFreq, string floatDC, string index, Calendar calendar, Natural spotDays, bool spotStartLag)
QuantLib::ext::shared_ptr< Trade > buildCPIInflationSwap(string id, string ccy, bool isPayer, Real notional, int start, Size term, Real spread, string floatFreq, string floatDC, string index, string cpiFreq, string cpiDC, string cpiIndex, Real baseRate, string observationLag, bool interpolated, Real cpiRate)
QuantLib::ext::shared_ptr< Trade > buildZeroBond(string id, string ccy, Real notional, Size term, string suffix)
QuantLib::ext::shared_ptr< Trade > buildBermudanSwaption(string id, string longShort, string ccy, bool isPayer, Real notional, Size exercises, int start, Size term, Real rate, Real spread, string fixedFreq, string fixedDC, string floatFreq, string floatDC, string index, string cashPhysical, Real premium, string premiumCcy, string premiumDate)
QuantLib::ext::shared_ptr< Trade > buildEquityOption(string id, string longShort, string putCall, Size expiry, string equityName, string currency, Real strike, Real quantity, Real premium, string premiumCcy, string premiumDate)
QuantLib::ext::shared_ptr< Trade > buildFloor(string id, string ccy, string longShort, Real floorRate, Real notional, int start, Size term, string floatFreq, string floatDC, string index, Calendar calendar, Natural spotDays, bool spotStartLag)
QuantLib::ext::shared_ptr< Trade > buildCrossCcyBasisSwap(string id, string recCcy, Real recNotional, string payCcy, Real payNotional, int start, Size term, Real recLegSpread, Real payLegSpread, string recFreq, string recDC, string recIndex, Calendar recCalendar, string payFreq, string payDC, string payIndex, Calendar payCalendar, Natural spotDays, bool spotStartLag, bool notionalInitialExchange, bool notionalFinalExchange, bool notionalAmortizingExchange, bool isRecLegFXResettable, bool isPayLegFXResettable)
QuantLib::ext::shared_ptr< Trade > buildYYInflationSwap(string id, string ccy, bool isPayer, Real notional, int start, Size term, Real spread, string floatFreq, string floatDC, string index, string yyFreq, string yyDC, string yyIndex, string observationLag, Size fixDays)
QuantLib::ext::shared_ptr< Trade > buildEquityForward(string id, string longShort, Size expiry, string equityName, string currency, Real strike, Real quantity)
QuantLib::ext::shared_ptr< Trade > buildCapFloor(string id, string ccy, string longShort, vector< Real > capRates, vector< Real > floorRates, Real notional, int start, Size term, string floatFreq, string floatDC, string index, Calendar calendar, Natural spotDays, bool spotStartLag)
QuantLib::ext::shared_ptr< Trade > buildCommodityForward(const std::string &id, const std::string &position, Size term, const std::string &commodityName, const std::string ¤cy, Real strike, Real quantity)
QuantLib::ext::shared_ptr< Trade > buildEuropeanSwaption(string id, string longShort, string ccy, bool isPayer, Real notional, int start, Size term, Real rate, Real spread, string fixedFreq, string fixedDC, string floatFreq, string floatDC, string index, string cashPhysical, Real premium, string premiumCcy, string premiumDate)
QuantLib::ext::shared_ptr< Trade > buildYYInflationCapFloor(string id, string ccy, Real notional, bool isCap, bool isLong, Real capFloorRate, int start, Size term, string yyFreq, string yyDC, string yyIndex, string observationLag, Size fixDays)
string toString(Date d)
Utilities to set up simple test trades.
QuantLib::ext::shared_ptr< Trade > buildCommodityOption(const string &id, const string &longShort, const string &putCall, Size term, const string &commodityName, const string ¤cy, Real strike, Real quantity, Real premium, const string &premiumCcy, const string &premiumDate)