Logo Search packages:      
Sourcecode: quantlib version File versions


/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */

 Copyright (C) 2003 Ferdinando Ametrano
 Copyright (C) 2007 StatPro Italia srl

 This file is part of QuantLib, a free-software/open-source library
 for financial quantitative analysts and developers - http://quantlib.org/

 QuantLib is free software: you can redistribute it and/or modify it
 under the terms of the QuantLib license.  You should have received a
 copy of the license along with this program; if not, please email
 <quantlib-dev@lists.sf.net>. The license is also available online at

 This program is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE.  See the license for more details.

#include <ql/instruments/quantoforwardvanillaoption.hpp>

namespace QuantLib {

                   const Handle<YieldTermStructure>& foreignRiskFreeTS,
                   const Handle<BlackVolTermStructure>& exchRateVolTS,
                   const Handle<Quote>& correlation,
                   Real moneyness,
                   Date resetDate,
                   const boost::shared_ptr<StochasticProcess>& process,
                   const boost::shared_ptr<StrikedTypePayoff>& payoff,
                   const boost::shared_ptr<Exercise>& exercise,
                   const boost::shared_ptr<PricingEngine>& engine)
    : QuantoVanillaOption(foreignRiskFreeTS, exchRateVolTS, correlation,
                          process, payoff, exercise, engine),
      moneyness_(moneyness), resetDate_(resetDate) {
        QL_REQUIRE(engine, "null engine or wrong engine type");

00041     void QuantoForwardVanillaOption::setupArguments(
                                       PricingEngine::arguments* args) const {
        QuantoForwardVanillaOption::arguments* arguments =
        QL_REQUIRE(arguments != 0,
                   "pricing engine does not supply needed arguments");

        arguments->foreignRiskFreeTS = foreignRiskFreeTS_;
        arguments->exchRateVolTS = exchRateVolTS_;
        QL_REQUIRE(!correlation_.empty(), "null correlation given");
        arguments->correlation = correlation_->value();

        arguments->moneyness = moneyness_;
        arguments->resetDate = resetDate_;

00058     void QuantoForwardVanillaOption::performCalculations() const {

        /* we must set the arguments of the underlying engine
           (which cannot be done by QuantoEngine.) */
        typedef QuantoEngine<ForwardVanillaOption::arguments,
                             ForwardVanillaOption::results> engine_type;
        boost::shared_ptr<engine_type> qengine =
        QL_REQUIRE(qengine, "wrong engine given");
        ForwardVanillaOption::arguments* args = qengine->underlyingArgs();
        args->moneyness = moneyness_;
        args->resetDate = resetDate_;

        // now go on with the show as originally scheduled


Generated by  Doxygen 1.6.0   Back to index