In [1]:
using Dates
include("jlFiles/printmat.jl")
include("jlFiles/printTable.jl")
Out[1]:
In [2]:
using Plots
#pyplot(size=(600,400))
gr(size=(480,320))
default(fmt = :svg)
In [3]:
y = 0.05
m = 3/4
Z = 100
PV = exp(-y*m)*Z
printlnPs("PV of $Z: ",PV)
Recall: the payoff of a forward contract (at expiration, $m$ periods ahead) is $S_{m}-F$
In [4]:
Sₘ = 0:15 #possible values of the underlying price at expiration
F = 5
ForwardPayoff = Sₘ .- F
plot( Sₘ,ForwardPayoff,
linecolor = :red,
linewidth = 2,
legend = false,
title = "Payoff of forward contract (F = $F)",
xlabel = "Asset price at expiration" )
hline!([0],linecolor=:black,line=(:dash,1))
vline!([F],linecolor=:black,line=(:dash,1))
Out[4]:
Recall: for an asset without dividends (at least until expiration of the forward contract), $F=e^{my}S$
For an asset with continuous dividends at the rate $\delta$, $F=e^{m(y-\delta)}S$
In [5]:
y = 0.05 #interest rate
m = 3/4 #time to expiration (in years)
S = 100 #spot price now
F_A = exp(m*y)*S #forward price
δ = 0.01 #dividend rate
F_B = exp(m*(y-δ))*S #forward price
printblue("Forward prices:")
printTable([F_A F_B],["no dividends";"with dividends"],[""],width=16)
Recall: the forward price (with expiration $m$ of the forward) of a bond that matures in $n$ is $F=e^{my(m)}B(n)$, where $y(m)$ denotes the interest for an $m$-period loan.
By definition, $1/B(m)= e^{my(m)}$. Combine to get
$F=B(n)/B(m)$
In [6]:
m = 5 #time to expiration of forward
n = 7 #time to maturity of bond
ym = 0.05 #interest rates
yn = 0.06
Bm = exp(-m*ym) #bond price now
Bn = exp(-n*yn)
F = Bn/Bm #forward price a bond maturing in n, delivered in m<n
printblue("bond and forward prices: ")
xx = [Bm,Bn,F]
printTable(xx,["price"],["$m-bond","$n-bond","$m->$n forward"])
The "dividend rate" on foreign currency is the foreign interest rate $y^*$ (since you can keep the foreign currency on a foreign bank account). The forward-spot parity then gives $F=e^{m(y-y^*)}S$.
We also calculate the return on a "covered" strategy: (a) buy foreign currency (in $t=0$); (b) lend it abroad (in $t=0$); (c) enter a forward on the domestic currency (in $t=0$); (d) pay forward price and get domestic currency (in $t=m$).
In [7]:
m = 1 #time to expiration
y = 0.0665 #domestic interest rate
ystar = 0.05 #foreign interest rate
S = 1.2 #exchange rate now
F = S*exp(m*(y-ystar))
printlnPs("Forward price of foreign currency: ",F)
TradingReturn = exp(ystar)*F/S - 1
logTR = log(TradingReturn+1)
printlnPs("\nlog return on covered strategy, %: ",100*logTR)
printlnPs("compare with domestic interest rate, %:",y*100)
In [ ]: