Logo Search packages:      
Sourcecode: quantlib version File versions  Download package

void QuantLib::ForwardVanillaOption::performCalculations (  )  const [protected, virtual]

In case a pricing engine is not used, this method must be overridden to perform the actual calculations and set any needed results. In case a pricing engine is used, the default implementation can be used.

Reimplemented from QuantLib::OneAssetStrikedOption.

Definition at line 45 of file forwardvanillaoption.cpp.

References QuantLib::Greeks::delta, QuantLib::Greeks::dividendRho, QuantLib::Greeks::gamma, QuantLib::OneAssetOption::isExpired(), QuantLib::Instrument::performCalculations(), QL_ENSURE, QuantLib::Greeks::rho, QuantLib::Greeks::theta, and QuantLib::Greeks::vega.

        if (isExpired()) {
            NPV_ = delta_ = gamma_ = theta_ =
                vega_ =   rho_ = dividendRho_ = strikeSensitivity_ = 0.0;
        } else {

            const ForwardVanillaOption::results* results =
                dynamic_cast<const ForwardVanillaOption::results*>(
            QL_ENSURE(results != 0,
                      "no results returned from pricing engine");
            delta_       = results->delta;
            gamma_       = results->gamma;
            theta_       = results->theta;
            vega_        = results->vega;
            rho_         = results->rho;
            dividendRho_ = results->dividendRho;


Generated by  Doxygen 1.6.0   Back to index