Here’s a copy of a spreadsheet that I authored which uses the Black-Scholes-Merton option pricing formula to price a call option (along with an otherwise identical (same underlying asset, same exercise price, same time to expiration) put option; you can bring up the spreadsheet by clicking on the screenshot below):In order to calculate the arbitrage-free price of a call option, we need to solve the following equation:
where and . The arbitrage-free price for the put may be obtained by applying the put-call parity equation. By doing so, we obtain the put pricing equation for an otherwise identical (same underlying, same exercise price, same time to expiration) put:
where and .
For calls and puts, we need five parameter values: S (current underlying asset price), K (exercise price, (volatility of underlying asset return), T (time to expiration, measured in number of years), and r (the annualized riskless rate of interest). These parameters all show up in cells B1:B5. The first step to solving call and put prices requires determining the values for and ; these values are listed in cells B7:B12. Once we obtain this information, it’s simply a matter of coding the equations for the BSM call and put prices; these prices show up in cells E1:E2.
Finally, I also include the components of the replicating portfolios for the call and put options. Of course, the values of these portfolios must be the same as the call and put option values; otherwise, there would be riskless arbitrage opportunities. As on pp. 17-22 of the Derivatives Theory, part 1 lecture note, one replicates a call option by buying delta units of the underlying asset on margin, whereas one replicates a put option by shorting delta units of the underlying asset and lending money. In the Black-Scholes-Merton pricing model, the call delta corresponds to , whereas the put delta corresponds to .