Following this document on how to port a python
QL
program to C++
, I try:
auto cp = 'C';
auto k = 100.0;
auto u = make_shared<SimpleQuote>(100.0);
auto r = make_shared<SimpleQuote>(0.01);
auto sigma = make_shared<SimpleQuote>(0.20);
auto t = calendar.businessDaysBetween(d1, expiry) / cDays;
auto exercise = EuropeanExercise(expiry);
auto payoff = ('C' == cp ? PlainVanillaPayoff(Option::Call, k) :
PlainVanillaPayoff(Option::Put, k));
auto european_option = EuropeanOption(
boost::make_shared<PlainVanillaPayoff>(payoff),
boost::make_shared<EuropeanExercise>(exercise));
auto riskFreeCurve =
make_shared<FlatForward>(0, TARGET(), Handle<Quote>(r), Actual360());
I get the following error:
qldate.cpp:49:58: error: no matching function for call to \u2018QuantLib::Handle<QuantLib::Quote>::Handle(std::shared_ptr<QuantLib::SimpleQuote>&)\u2019
make_shared<FlatForward>(0, TARGET(), Handle<Quote>(r), Actual360());