You are on page 1of 13

Homework1

101071010

Count the present value


Write a function
pvvar,pvfix

Write a function

pvvar,pvfix

PVVAR
PV of varying cash flow
PV=pvvar(Cashflow, yield)

PV=pvvar(Cashflow, yield, CFdates)


Cashflow->[CF0,CF1,CF2,]0cf
CFdates->['01/12/1987
'02/14/1988',]

PVFIX
PV of fix cash flow
PV=pvfix(Rate,Periods,Payment, ExtraPayment,Due);

Rate
Periods
Paymentcashflow
ExtraPaymentcashflow

Due(01)

4%0cashflow
20000?

Function

PVVAR

PVFIX

Count the Call&Put price by BS Model


d1=(log(S0/X)+(r+sigma^2/2)*T) / (sigma*sqrt(T));
d2=d1-(sigma*sqrt(T));
C=S0*normcdf(d1)-X*(exp(-rT) * normcdf(d2));
P=X*exp(-r*T)*normcdf(-d2)-S0*normcdf(-d1);

Write a Call function

Write a Put function

Call Price

Put Price

How about adding q(dividends)?

You might also like