Class TenorCalculator

Inheritance Relationships

Derived Types

Class Documentation

class TenorCalculator

Abstract base class for calculating time-based values (e.g., year fractions, time durations).

This class provides methods for calculating the fraction of a year between two given times and other related time-based operations.

Subclassed by otyca::ImpliedVarianceTenorCalculator, otyca::RealizedVarianceTenorCalculator

Public Functions

inline virtual double tenor(const boost::posix_time::ptime &begin, const boost::posix_time::ptime &end) const

Calculates the fraction of a year between two given points in time.

Parameters:
  • begin – The start time.

  • end – The end time.

Returns:

The fraction of the year between the two times.

inline virtual ~TenorCalculator()

Virtual destructor for TimeCalculator.

Public Static Functions

static double time_duration_to_days(const boost::posix_time::time_duration &time_duration)

Converts a time duration into the equivalent number of days.

Parameters:

time_duration – The time duration to convert.

Returns:

The number of days represented by the given time duration.

static boost::posix_time::time_duration days_to_time_duration(double days)

Converts a number of days into a time duration.

Parameters:

days – The number of days to convert.

Returns:

The corresponding time duration.