Closed afoster28 closed 8 months ago
This version will allow users to input option parameters in the format optType, dir, K, T, Q and use default values for the Spot Price (S), Risk-free Interest Rate (r), and Volatility (sigma)
In this program:
The user is prompted to enter the parameters for each option in the specified format (optType, dir, K, T, Q).
The parameters are read and used to create a BlackScholes object with the default values for S, r, and sigma.
The created BlackScholes object is added to the Portfolio.
The user can enter as many options as desired and type exit to finish inputting data.
After exiting the input loop, the program calculates and displays the variance of the portfolio.
Here goes the code:
We should enter the parameters with space after the comma. For example: C, L, 4800, 60, 10