Usage: |
opc = GarmanKohlhagen(S, K, vol, rd, rf, tau, cp, task)
|
Input: |
| S | array, the spot FX rate
|
| K | array, exercise price
|
| vol | array, volatility (annualized)
|
| rd | scalar, domestic riskless interest rate (annualized)
|
| rf | scalar, foreign riskless interest rate (annualized)
|
| tau | scalar, time to expiration (in years)
|
| cp | scalar, option type
cp=1 for call option
cp=-1 for put option
|
| task | scalar, if task=0, calculate the option price (default)
if task=1, calculate the option delta
if task=20, calculate the strike of the option
given its delta (as the K paramter)
|
Output: |
| opc | array, option price, greeks or strike (for task=20)
depending on the value of the task parameter |