thesiswriting

# python help please – Nursing Writers Hub

python help please – Nursing Writers Hub

A type-Z option has the following payoff function:

{ K[1+sin(2*pi*St/(K))]   if St<K

F(St)=

{K*exp^1-St/(k)           if St>=K

1. Write a Python function with the following definition: def f(ST,K):

which calculates the payoff of a type-Z option.
Write a Python function with the following definition:

def plotTypeZPayoff (K,STMax):

which plots the payoff function of the type-Z option as a function of ST for given K. The range of the horizontal axis should be [0,STMax] and vertical axis [0,2.1K]. Include this graph in your written work for the case K = 20,STMax = 100.

2. Write a loop based binomial options pricing function with the definition: def binomOption(payoff ,steps ,T,sigma,S0,r): where payoff is a function of one variable. The variable sigma (Ïƒ) is the volatility, âˆšâˆš related to u and d by u=exp(Ïƒ sqrt(Î´t)) and d=exp(âˆ’Ïƒ sqrt(Î´t)). Write a factory function with the definition:

def makeZPayoff(K):
which returns a type-Z payoff function with fixed K.

3. Fix T = 1,r = 0.05,K = 20,S0 = 15,steps = 200. Calculate the value of the type-Z option for Ïƒ âˆˆ {0.01, 0.1, 0.2, 0.3}. Produce a two column table of Ïƒ values and the corresponding option values in your written work. Explain why increasing Ïƒ increases the value of the option in this example. What do you expect to happen as Ïƒ â†’ âˆž and why? If S0 = K, what would be the effect of increasing Ïƒ and why?

1. Fix T = 1,r = 0.05,K = 20,S0 = 15,steps = 200. Produce a graph of the type-Z optionâ€™s value at t = 0 as a function of S0 for S0 âˆˆ [0,100] for each of the following values of Ïƒ : {0.01, 0.1, 0.2, 0.3}. Show all four graphs on the same axes and include it in your written work. What effect does increasing volatility have on the price graph and why?

2. Fix T = 1,r = 0.05,K = 20,S0 = 15,steps = 200 and suppose the optionâ€™s value is V0 = 2.0. Write a root finding function to calculate the volatility Ïƒ correct to 6 significant figures. Include the result in your written work.

##### Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!Use Discount Code “Newclient” for a 15% Discount!

NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you. Scroll to Top