Answered step by step
Verified Expert Solution
Question
1 Approved Answer
7.(10pt) Download Excel options model with VBA code from the courseworks . Save as a source. Open in Excel.Modify the Black model for futures to
7.(10pt) Download Excel options model with VBA code from the courseworks . Save as a source. Open in Excel.Modify the Black model for futures to Black-Scholes model for stocks paying dividends at rate q (like in the Hull?sbook). Make the necessary changes in Visual Basic code. Use Excel help or consult TA?s if you do not know whatto do. Check that code works and submit the code printout.
Global Const Pi = 3.14159265358979 Option Explicit 'Requirs that all variables to be declared explicitly. Option Compare Text 'Uppercase letters to be equivalent to lowercase letters. Option Base 1 'The "Option Base" statment alowws to specify 0 or 1 as the 'default first index of arrays. '// The normal distribution function Public Function ND(X As Double) As Double ND = 1 / Sqr(2 * Pi) * Exp(X ^ 2 / 2) End Function '// The cumulative normal distribution function Public Function CND(X As Double) As Double Dim L As Double, K As Double Const a1 = 0.31938153: Const a2 = 0.356563782: Const a3 = 1.781477937: Const a4 = 1.821255978: Const a5 = 1.330274429 L = Abs(X) K = 1 / (1 + 0.2316419 * L) CND = 1 1 / Sqr(2 * Pi) * Exp(L ^ 2 / 2) * (a1 * K + a2 * K ^ 2 + a3 * K ^ 3 + a4 * K ^ 4 + a5 * K ^ 5) If XStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started