The source code for Margarble's formula in QuantLib is here. The implementation requires a forward price be computed:

    Real forward1 = process1_->stateVariable()->value() *
        dividendDiscount1 / riskFreeDiscount;
    Real forward2 = process2_->stateVariable()->value() *
        dividendDiscount2 / riskFreeDiscount;

Why do we have to calculate the forward price? Margrable's formula explicity states that risk-free interest rate is not assumed because we can price the option under a stock measure. The formula in the original paper and wikipedia doesn't require it.

    Real d1 = (std::log((quantity1*forward1)/(quantity2*forward2))
               + 0.5*variance) / stdDev;

If one of the dividends is zero, we would get into a situation of log(0). Where do the extra terms that not shown come from?


1 Answer 1


you don't need the risk-free rate, it's just the way it's been implemented. It will cancel out when you take the ratio of the forwards.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.