24#ifndef quantlib_garman_klass_hpp
25#define quantlib_garman_klass_hpp
52 start = quoteSeries.
begin();
53 for (cur = start; cur != quoteSeries.
end(); ++cur) {
85 T(
y),
f_(marketOpenFraction),
a_(a) {};
89 start = quoteSeries.
begin();
91 for (cur = start; cur != quoteSeries.
end(); ++cur) {
93 Real c0 = std::log(prev->second.close());
94 Real o1 = std::log(cur->second.open());
96 a_ * (o1 - c0) * (o1 - c0) /
f_ +
97 (1-
a_) * T::calculatePoint(cur->second) /
100 retval[cur->first] = std::sqrt(sigma2/T::yearFraction_);
126 return (u -
d) * (u -
d) / 4.0 / std::log(2.0);
152 return 0.511 * (u -
d) * (u -
d) - 0.019 * (c * (u +
d) - 2 * u *
d) - 0.383 * c * c;
166 return 0.5 * (u -
d) * (u -
d) - (2.0 * std::log(2.0) - 1.0) * c * c;
Garman-Klass volatility model.
TimeSeries< Volatility > calculate(const TimeSeries< IntervalPrice > "eSeries) override
virtual Real calculatePoint(const IntervalPrice &p)=0
GarmanKlassAbstract(Real y)
TimeSeries< Volatility > calculate(const TimeSeries< IntervalPrice > "eSeries) override
GarmanKlassOpenClose(Real y, Real marketOpenFraction, Real a)
GarmanKlassSigma1(Real y, Real marketOpenFraction)
GarmanKlassSigma3(Real y, Real marketOpenFraction)
Real calculatePoint(const IntervalPrice &p) override
GarmanKlassSigma4(Real y)
Real calculatePoint(const IntervalPrice &p) override
GarmanKlassSigma5(Real y)
GarmanKlassSigma6(Real y, Real marketOpenFraction)
Real calculatePoint(const IntervalPrice &p) override
GarmanKlassSimpleSigma(Real y)
Real calculatePoint(const IntervalPrice &p) override
Container for historical data.
Container::const_iterator const_iterator
const_iterator begin() const
const_iterator end() const
Volatility term structures.