Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
vanillaforwardoption.hpp
Go to the documentation of this file.
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2020 Quaternion Risk Management Ltd
5 All rights reserved.
6
7 This file is part of ORE, a free-software/open-source library
8 for transparent pricing and risk analysis - http://opensourcerisk.org
9
10 ORE is free software: you can redistribute it and/or modify it
11 under the terms of the Modified BSD License. You should have received a
12 copy of the license along with this program.
13 The license is also available online at <http://opensourcerisk.org>
14
15 This program is distributed on the basis that it will form a useful
16 contribution to risk analytics and model standardisation, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
19*/
20
21/*! \file vanillaforwardoption.hpp
22 \brief Vanilla forward option on a single asset
23*/
24
25#ifndef quantext_vanilla_forward_option_hpp
26#define quantext_vanilla_forward_option_hpp
27
28#include <ql/instruments/vanillaoption.hpp>
29#include <ql/instruments/payoffs.hpp>
30
31namespace QuantExt {
32
33 //! Vanilla Forward option on a single asset
34 /*! \ingroup instruments */
35 class VanillaForwardOption : public QuantLib::VanillaOption {
36 public:
37 class arguments;
38 class engine;
39 VanillaForwardOption(const QuantLib::ext::shared_ptr<QuantLib::StrikedTypePayoff>& payoff,
40 const QuantLib::ext::shared_ptr<QuantLib::Exercise>& exercise, const QuantLib::Date& forwardDate,
41 const QuantLib::Date& paymentDate)
42 : VanillaOption(payoff, exercise), forwardDate_(forwardDate), paymentDate_(paymentDate) {}
43
44 VanillaForwardOption(const QuantLib::ext::shared_ptr<QuantLib::StrikedTypePayoff>& payoff,
45 const QuantLib::ext::shared_ptr<QuantLib::Exercise>& exercise, const QuantLib::Date& forwardDate)
46 : VanillaOption(payoff, exercise), forwardDate_(forwardDate) {}
47
49
50 private:
51 QuantLib::Date forwardDate_;
52 QuantLib::Date paymentDate_;
53 };
54
55 //! %Arguments for Vanilla Forward Option calculation
57 public:
59 QuantLib::Date forwardDate;
60 QuantLib::Date paymentDate;
61 };
62
64 VanillaOption::setupArguments(args);
65
67 dynamic_cast<VanillaForwardOption::arguments*>(args);
68 QL_REQUIRE(arguments != 0, "wrong argument type");
69
72 }
73
74 //! base class for swaption engines
75 class VanillaForwardOption::engine : public QuantLib::GenericEngine<VanillaForwardOption::arguments, VanillaOption::results> {};
76}
77
78
79#endif
80
Arguments for Vanilla Forward Option calculation
Vanilla Forward option on a single asset.
VanillaForwardOption(const QuantLib::ext::shared_ptr< QuantLib::StrikedTypePayoff > &payoff, const QuantLib::ext::shared_ptr< QuantLib::Exercise > &exercise, const QuantLib::Date &forwardDate)
VanillaForwardOption(const QuantLib::ext::shared_ptr< QuantLib::StrikedTypePayoff > &payoff, const QuantLib::ext::shared_ptr< QuantLib::Exercise > &exercise, const QuantLib::Date &forwardDate, const QuantLib::Date &paymentDate)
void setupArguments(QuantLib::PricingEngine::arguments *) const override