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

Rate QuantLib::DigitalCoupon::callOptionRate (  ) const [inherited]

Returns the call option rate (multiplied by: nominal*accrualperiod*discount is the NPV of the option)

Definition at line 180 of file digitalcoupon.cpp.

References QuantLib::DigitalCoupon::callDigitalPayoff_, QuantLib::DigitalCoupon::callLeftEps_, QuantLib::DigitalCoupon::callStrike_, QuantLib::DigitalCoupon::isCallCashOrNothing_, and QuantLib::CappedFlooredCoupon::rate().

Referenced by QuantLib::DigitalCoupon::rate().


        Rate callOptionRate = Rate(0.);
        if(hasCallStrike_) {
            // Step function
            callOptionRate = isCallCashOrNothing_ ? callDigitalPayoff_ : callStrike_;
            CappedFlooredCoupon next(underlying_, callStrike_ + callRightEps_);
            CappedFlooredCoupon previous(underlying_, callStrike_ - callLeftEps_);
            callOptionRate *= (next.rate() - previous.rate())
                            / (callLeftEps_ + callRightEps_);
            if (!isCallCashOrNothing_) {
                // Call
                CappedFlooredCoupon atStrike(underlying_, callStrike_);
                Rate call = underlying_->rate() - atStrike.rate();
                // Sum up
                callOptionRate += call;
        return callOptionRate;

Here is the call graph for this function:

Here is the caller graph for this function:

Generated by  Doxygen 1.6.0   Back to index