Compute the prices of European call or put out or in barrier options.
Reference: Espen Gaarder Haug, "Complete Guide to Option Pricing Formulas",
2nd Edition, page 152ff.
Variables:
- CallPutFlag: Call: ’1’, Put: ’0’
- UpFlag: Up: ’U’, Down: ’D’
- OutorIn: ’out’ or ’in’ barrier option
- S: stock price at time 0
- X: strike price
- H: barrier
- T: time to maturity in days
- r: annual risk-free interest rate (continuously compounded)
- sigma: implied volatility of the stock price measured as annual
standard deviation
- q: dividend rate p.a., continously compounded
- Rebate: Rebate of barrier option