Pricing American Options using a bootstrapped yield curve

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Pricing American Options using a bootstrapped yield curve

kumar ganesh
Hi all, 

I am currently working on a project , where we are trying to price American options  by passing in a "piecewise yield curve" object ( as opposed to generating a flat forward yield term structure using the risk free rate) . To this end, I am trying to modify the GeneralizedBlackScholesProcess class in qlo/processes.cpp so as to take in a PiecewiseYieldCurve object as a parameter. I believe , we dont need to modify any other class in order to achieve this objective. Please let me know if my understanding is correct . 

I have however run in to problems while trying to modify the code in processes.hpp . I am copy-pasting my modifications below 

processes.hpp 

namespace QuantLib {
    
class GeneralizedBlackScholesProcess;
    class BlackVolTermStructure;
    class DayCounter;
    class Date;
template <class Traits, class Interpolator,
              template <class> class Bootstrap = IterativeBootstrap>
class PiecewiseYieldCurve;
}

namespace QuantLibAddin {
   template <class Traits, class Interpolator,
              template <class> class Bootstrap = IterativeBootstrap>
class GeneralizedBlackScholesProcess2:public ObjectHandler::LibraryObject<QuantLib::GeneralizedBlackScholesProcess> {
      public:
        GeneralizedBlackScholesProcess2(
            const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
            const boost::shared_ptr<QuantLib::BlackVolTermStructure>& blackVolTermStructureP,
            QuantLib::Real underlying,
            const QuantLib::DayCounter& dayCounter,
            const QuantLib::Date& settlementDate,
const boost::shared_ptr<QuantLib::PiecewiseYieldCurve<Traits,Interpolator,Bootstrap>>& piecewiseYieldCurveP,
QuantLib::Spread dividendYield,
            bool permanent);
    };

}

Processes.cpp 
template <class Traits, class Interpolator,
              template <class> class Bootstrap = IterativeBootstrap>
GeneralizedBlackScholesProcess2::GeneralizedBlackScholesProcess2(
const boost::shared_ptr<ObjectHandler::ValueObject> &properties,
const boost::shared_ptr<QuantLib::BlackVolTermStructure> &blackVolTermStructureP,
QuantLib::Real underlying, 
const QuantLib::DayCounter &dayCounter, 
const QuantLib::Date &settlementDate,
const boost::shared_ptr<QuantLib::PiecewiseYieldCurve<Traits,Interpolator,Bootstrap>>& piecewiseYieldCurveP
QuantLib::Spread dividendYield, 
bool permanent)
: ObjectHandler::LibraryObject<QuantLib::GeneralizedBlackScholesProcess>(properties, permanent) {

QuantLib::Handle<QuantLib::Quote> underlyingH(
            boost::shared_ptr<QuantLib::Quote>(
            new QuantLib::SimpleQuote(underlying)));


QuantLib::Handle<QuantLib::YieldTermStructure> yieldTermStructure(piecewiseYieldCurveP);
QuantLib::Handle<QuantLib::YieldTermStructure> flatDividendTS(
            boost::shared_ptr<QuantLib::YieldTermStructure>(
            new QuantLib::FlatForward(settlementDate, dividendYield, dayCounter)));

        QuantLib::Handle<QuantLib::BlackVolTermStructure>
            blackVolTermStructureH(blackVolTermStructureP);

        libraryObject_ = boost::shared_ptr<QuantLib::GeneralizedBlackScholesProcess> (
            new QuantLib::GeneralizedBlackScholesProcess(
                underlyingH,
                flatDividendTS,
                yieldTermStructure,
                blackVolTermStructureH));

}


However, when I compile I am getting the following error.
QuantLibAddin::GeneralizedBlackScholesProcess2' : use of class template requires template argument list
1>        .\qlo/processes.hpp(67) : see declaration of 'QuantLibAddin::GeneralizedBlackScholesProcess2'

1>.\qlo\processes.cpp(104) : error C2244: 'QuantLibAddin::GeneralizedBlackScholesProcess2<Traits,Interpolator,Bootstrap>::GeneralizedBlackScholesProcess2' : unable to match function definition to an existing declaration
1>        .\qlo/processes.hpp(69) : see declaration of 'QuantLibAddin::GeneralizedBlackScholesProcess2<Traits,Interpolator,Bootstrap>::GeneralizedBlackScholesProcess2'
1>        definition
1>        'QuantLibAddin::GeneralizedBlackScholesProcess2::GeneralizedBlackScholesProcess2(const boost::shared_ptr<T> &,const boost::shared_ptr<QuantLib::BlackVolTermStructure> &,QuantLib::Real,const QuantLib::DayCounter &,const QuantLib::Date &,const boost::shared_ptr<QuantLib::PiecewiseYieldCurve<Traits,Interpolator,Bootstrap>> &,QuantLib::Spread,bool)'
1>        with
1>        [
1>            T=ObjectHandler::ValueObject
1>        ]
1>        existing declarations
1>        'QuantLibAddin::GeneralizedBlackScholesProcess2<Traits,Interpolator,Bootstrap>::GeneralizedBlackScholesProcess2(const boost::shared_ptr<T> &,const boost::shared_ptr<QuantLib::BlackVolTermStructure> &,QuantLib::Real,const QuantLib::DayCounter &,const QuantLib::Date &,const boost::shared_ptr<QuantLib::PiecewiseYieldCurve<Traits,Interpolator,Bootstrap>> &,QuantLib::Spread,bool)'
1>        with
1>        [
1>            T=ObjectHandler::ValueObject


I have tried all possible options but to no avail . Could someone please point out where I am going wrong?? 
I really appreciate any help in this regard 

Thanks in Advance 

Kumaraganesh 

 
Thanks
Kumaraganesh Subramanian
MS in Financial Mathematics
Stanford University

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users