Usage: |
opc = BlackScholes(S, K, r, sigma, tau, task)
|
Input: |
| S | scalar: the current value of the index
|
| K | scalar: exercise price
|
| r | scalar: riskless interest rate
|
| sigma | scalar: Black Scholes implied volatility of the European option
|
| tau | scalar: time to expiration (by year)
|
| task | scalar: if task=1, calculate the call option price;
if task=0, calculate the put option price
if task="call" "Call" or "CALL", calculate the call option price;
if task="put" "PUT" or "Put" , calculate the put option price
|
Output: |
| opc | scalar: call option price or put option price |