QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
SwingExercise Class Reference

Swing exercise. More...

#include <ql/instruments/vanillaswingoption.hpp>

+ Inheritance diagram for SwingExercise:
+ Collaboration diagram for SwingExercise:

Public Member Functions

 SwingExercise (const std::vector< Date > &dates, const std::vector< Size > &seconds=std::vector< Size >())
 
 SwingExercise (const Date &from, const Date &to, Size stepSizeSecs)
 
const std::vector< Size > & seconds () const
 
std::vector< TimeexerciseTimes (const DayCounter &dc, const Date &refDate) const
 
- Public Member Functions inherited from BermudanExercise
 BermudanExercise (const std::vector< Date > &dates, bool payoffAtExpiry=false)
 
- Public Member Functions inherited from EarlyExercise
 EarlyExercise (Type type, bool payoffAtExpiry=false)
 
bool payoffAtExpiry () const
 
- Public Member Functions inherited from Exercise
 Exercise (Type type)
 
virtual ~Exercise ()=default
 
Type type () const
 
Date date (Size index) const
 
Date dateAt (Size index) const
 
const std::vector< Date > & dates () const
 Returns all exercise dates. More...
 
Date lastDate () const
 

Private Attributes

const std::vector< Sizeseconds_
 

Additional Inherited Members

- Public Types inherited from Exercise
enum  Type { American , Bermudan , European }
 
- Protected Attributes inherited from Exercise
std::vector< Datedates_
 
Type type_
 

Detailed Description

Swing exercise.

A Swing option can only be exercised at a set of fixed date times

Definition at line 37 of file vanillaswingoption.hpp.

Constructor & Destructor Documentation

◆ SwingExercise() [1/2]

SwingExercise ( const std::vector< Date > &  dates,
const std::vector< Size > &  seconds = std::vector<Size>() 
)
explicit

Definition at line 57 of file vanillaswingoption.cpp.

◆ SwingExercise() [2/2]

SwingExercise ( const Date from,
const Date to,
Size  stepSizeSecs 
)

Definition at line 75 of file vanillaswingoption.cpp.

Member Function Documentation

◆ seconds()

const std::vector< Size > & seconds ( ) const

Definition at line 81 of file vanillaswingoption.cpp.

+ Here is the caller graph for this function:

◆ exerciseTimes()

std::vector< Time > exerciseTimes ( const DayCounter dc,
const Date refDate 
) const

Definition at line 83 of file vanillaswingoption.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ seconds_

const std::vector<Size> seconds_
private

Definition at line 49 of file vanillaswingoption.hpp.