Black & Scholes Model
The VBA sub bs_future is shown below; it uses a number of Mercury functions to interact with GAUSS.
This VBA maco demonstrates the Black & Scholes Model
for evaluating future call and put options. In this example, the
sheet B&S is selected as the active sheet in line 2, and the
parameter values of the model taken from this sheet and set as
Gauss variables using the RangePut
command in lines 5 to 9. The call code is programmed in cells d5:d11 of the spreadsheet and this proc is then executed in
line 12 using the ExecCode command. The call value c is then evaluated in line
13, and returned to cell
e4 in line 14. A similar procedure is used for the put
value.