a function) named as “options_data.txt” in which the columns should contain
S, X, T, s, r, d. The data values are given below:
},,,,,,,,{S
,
}.,.,.,.{T
}.,.,.{s
and,
.d,.r,X
After creating the text file, you should have a 108-by-6 table since for each
value of T and s you have nine different possible values for S.
Note that the function:
• Should check if the correct number of input arguments is supplied
and display an error massage otherwise (to do so, use the build-in
function
n
n
a
a
r
r
g
g
i
i
n
n; see the help facilities for understanding its use).
• Set dividends equal to zero automatically if no dividend input is
supplied or if the dividend input argument is set to be an empty array
(use the build in function
e
e
x
x
i
i
s
s
t
t).
• In order to prevent an error, the function should check whether the
input parameters are all positive or non-negative (elaborate on the
BSM formula to see which inputs should be >=0 and which only >0; d
and especially r with negative values can exist but do not have any
economical implication).
• If “Index” takes a different value other than those explained before, an
error message should be returned and the program execution should
break. Additionally, an error should be returned and program
execution should stop if “Index” is a string matrix and not a string
vector (“Index” should be either 1-by-4 string vector in the case of a
'CALL' or a 1-by-3 in the case of a 'PUT').
Kommentare zu diesen Handbüchern