Open Office DG201 Functions
Open Office DG201 Functions
Important: Do not forget to set macro security on medium or low and Enable Macros
Page 1
Title
2.01
inux Users)
has been designed to
s:
atives" 8/E
s Markets" 8/E
ed from outlets such as
rsonstore.com/bookstore
Page 2
Equity Options
Page 3
Equity Options
Page 4
Binary Option
Page 5
Binary Option
Page 6
Barrier Option
Example: #VALUE!
Page 7
Barrier Option
Page 8
Average Option
Example: #VALUE!
Page 9
Average Option
Page 10
Chooser Option
Example: #VALUE!
Page 11
Chooser Option
Page 12
Compound Option
Function 7: CompoundOption(S, K1, r, q, vol, T1, IsCall, IsFut, K2, T2, IsOptionOnCall, Result)
Carries out calculations for compound options on non-dividend-paying stocks, stock indices, currencies and futures
Arguments:
S 50 Asset Price
K1 5 First Strike Price
r 0.05 Domestic risk-free rate
q 0.02 Dividend yield for stock index options, foreign risk free rate for currency options (Enter 0 if this
vol 0.25 Volatility. BUT Enter Price if Implied Volatility is to be calculated (i.e. Result=6)
T1 0.35 Time to first exercise
IsCall 1 1 if Call, 0 if Put
IsFut 0 1 if Fut, 0 otherwise
K2 50 Second strike price
T2 1 Time to second exercise
IsOptionOnCall 1 1 if second option is a call, 0 if second option is a put
Result 0 0=Price; 1=Delta; 2=Gamma; 3=Vega; 4=Theta; 5=Rho; 6=Implied Vol
Example: #VALUE!
Page 13
Compound Option
Page 14
Lookback Option
Example: #VALUE!
Page 15
Lookback Option
Page 16
Caps
Function 10: BlackCap(Start, End, CapRate, L, Frequ, vol, IsCap, Zeros, Result)
Carries out calculations for caps and floors using Black's model
Arguments:
Start 0 Time (years from today) when cap starts
End 5 Time (years from today) when cap ends
CapRate 0.05 Cap Rate
L 100 Notional amount
Frequ 4 Number of times a year cap is settled (= 12, 4, 2, or 1)
vol 0.25 Flat volatility. BUT enter price if implied volatility is to be calculated (i.e. Result=4)
IsCap 1 1 if cap, 0 if Floor
Zeros Array containing zero curve: Maturities in the first column and zero rates in second column
Result 0 0=Price, 1=Delta, 2=Gamma, 3=Vega, 4=ImpliedVol
Example: #VALUE!
Function 11: HullWhiteCap(Start, End, CapRate, L, Frequ, sigma, a, IsCap, Zeros, Result)
Carries out calculations for caps and floors using Hull-White model
Arguments:
Start 0 Time (years from today) when cap starts
End 5 Time (years from today) when cap ends
CapRate 0.05 Cap Rate
L 100 Notional amount
Frequ 4 Number of times a year cap is settled (= 12, 4, 2, or 1)
sigma 0.015 Short rate standard deviation. But enter price if implied sigma is to be calculated (i.e. Result=4)
a 0.075 Reversion rate
IsCap 1 1 if Cap; 0 otherwise
Zeros Array containing zero curve: Maturities in the first column and zero rates in second column
Result 0 0=Price, 1=Delta, 2=Gamma, 3=Vega, 4=ImpliedVol
Example: #VALUE!
Page 17
Caps
Term Structure
0 3.000%
0.5 3.353%
1 3.664%
1.5 3.938%
2 4.180%
2.5 4.394%
3 4.583%
culated (i.e. Result=4) 3.5 4.749%
4 4.896%
nd zero rates in second column 4.5 5.026%
5 5.140%
5.5 5.241%
6 5.331%
6.5 5.409%
7 5.479%
7.5 5.540%
8 5.594%
8.5 5.642%
9 5.684%
9.5 5.721%
10 5.754%
Page 18
Swap Options
Function 13: BlackSwapOpt(Start, End, SwapRate, L, Frequ, vol, IsPayFix, Zeros, Result)
Carries out calculations for swap options using Black's model
Arguments:
Start 2 Time (years from today) when option matures
End 7 Time (years from today) when underlying swap ends
SwapRate 0.06 Strike Swap Rate
L 100 Principal amount
Frequ 2 Frequency of payments on swap (= 12, 4, 2, or 1)
vol 0.25 Volatility. BUT enter price if implied volatility is to be calculated (i.e. Result=4)
IsPayFix 1 1 if option to pay strike swap rate, 0 if option to receive strike swap rate
Zeros Array containing zero curve: Maturities in the first column and zero rates in second column
Result 0 0=Price, 1=Delta, 2=Gamma, 3=Vega, 4=Implied Volatility
Example: #VALUE!
Function 14: HullWhiteSwapOpt(Start, End, SwapRate, L, Frequ, sigma, a, IsPayFix, Zeros, Result)
Carries out calculations for swap options using the Hull-White model
Arguments:
Start 2 Time (years from today) when option matures
End 7 Time (years from today) when underlying swap ends
SwapRate 0.06 Strike Swap Rate
L 100 Principal amount
Frequ 2 Frequency of payments on swap (= 12, 4, 2, or 1)
sigma 0.015 Short rate standard deviation. But enter price if implied sigma is to be calculated (i.e. Result=4)
a 0.075 Reversion rate
IsPayFix 1 1 if option to pay strike swap rate, 0 if option to receive strike swap rate
Zeros Array containing zero curve: Maturities in the first column and zero rates in second column
Result 0 0=Price, 1=Delta, 2=Gamma, 3=Vega, 4=Implied sigma
Example: #VALUE!
Page 19
Swap Options
Term Structure
0 3.000%
0.5 3.353%
1 3.664%
1.5 3.938%
2 4.180%
2.5 4.394%
3 4.583%
ted (i.e. Result=4) 3.5 4.749%
4 4.896%
nd zero rates in second column 4.5 5.026%
5 5.140%
5.5 5.241%
6 5.331%
6.5 5.409%
7 5.479%
x, Zeros, Result) 7.5 5.540%
8 5.594%
8.5 5.642%
9 5.684%
9.5 5.721%
10 5.754%
Page 20
Bond Options
Function 16: BlackBondOpt(BondLife, Coupon, Princ, Frequ, K, T, vol, IsCall, IsQuoted, Zeros, Result)
Carries out calculations for bond options using Black's model
Arguments:
BondLife 7 Life of bond in years(from today)
Coupon 0.06 Coupon (rate per year)
Princ 100 Bond Principal
Frequ 2 Frequency of payments on bond (=4, 2, or 1)
K 99.5 Strike Price
T 1 Time (in years) to option maturity
vol 0.2 Volatility. BUT enter price if implied volatility is to be calculated (i.e. Result=4)
IsCall 1 1 if Call, 0 if Put
IsQuoted 1 1 if strike is a quoted price, 0 if strike is cash price
Zeros Array containing zero curve: Maturities in the first column and zero rates in second column
Result 0 0=Price, 1=Delta, 2=Gamma, 3=Vega, 4=Implied sigma
Example: #VALUE!
Function 17: HullWhiteBondOpt(BondLife, Coupon, Princ, Frequ, K, T, sigma, a, IsCall, IsQuoted, Zeros, Result)
Carries out calculations for bond options using Hull-White model
Arguments:
BondLife 7 Life of bond in years(from today)
Coupon 0.06 Coupon (rate per year)
Princ 100 Bond Principal
Frequ 2 Frequency of payments on bond (=4, 2, or 1)
K 99.5 Strike Price
T 1 Time (in years) to option maturity
sigma 0.0125 Short rate standard deviation. But enter price if implied sigma is to be calculated (i.e. Result=4)
a 0.07 Reversion rate
IsCall 1 1 if Call, 0 if Put
IsQuoted 1 1 if strike is a quoted price, 0 if strike is cash price
Zeros Array containing zero curve: Maturities in the first column and zero rates in second column
Result 0 0=Price, 1=Delta, 2=Gamma, 3=Vega, 4=Implied sigma
Example: #VALUE!
Page 21
Bond Options
Page 22
Bond and Swap
Example: #VALUE!
Example: #VALUE!
Page 23
Bond and Swap
Term Structure
0 3.000%
0.5 3.353%
1 3.664%
1.5 3.938%
2 4.180%
2.5 4.394%
nd zero rates in second column 3 4.583%
3.5 4.749%
4 4.896%
4.5 5.026%
5 5.140%
5.5 5.241%
6 5.331%
6.5 5.409%
et dates prior to Start date 7 5.479%
7.5 5.540%
8 5.594%
8.5 5.642%
ency corresponds to Frequ) 9 5.684%
9.5 5.721%
10 5.754%
nd zero rates in second column
Page 24
CDS functions
Example: #VALUE!
Example: #VALUE!
Example: #VALUE!
Page 25
CDS functions
Page 26
CDS functions
Hazard Rates
0 0.500%
0.5 1.000%
1 1.250%
hazard rates column 2 2 1.000%
5 1.000%
10 1.000%
Term Structure
0 3.000%
0.5 3.353%
1 3.664%
1.5 3.938%
2 4.180%
nd zero rates in second column 2.5 4.394%
hazard rates column 2 3 4.583%
3.5 4.749%
4 4.896%
4.5 5.026%
5 5.140%
5.5 5.241%
6 5.331%
6.5 5.409%
7 5.479%
7.5 5.540%
8 5.594%
8.5 5.642%
9 5.684%
nd zero rates in second column 9.5 5.721%
hazard rates column 2 10 5.754%
e of CDS spreads
n 1, spreads in column 2
CDS Spreads
1 25
Page 27
CDS functions
2 40
3 50
4 55
5 60
10 64
Page 28
CDO functions
Function 26: CDO_Spread(Life, Frequ, Recovery, Attach, Detach, Correlation, nFirms, nPoints, Zeros, HazardRates)
Calculates the breakeven CDO spread in basis points
Arguments:
Life 5 Life of the CDS in years
Frequ 4 Frequency of payments on the CDS (=12, 4, 2, or 1)
Recovery 0.4 Recovery rate in the event of default (0<= R <=1)
Attach 0.03 Tranche attachment point (A >= 0)
Detach 0.07 Tranche detachment point (A < D <= 1)
Correlation 0.25 Copula Correlation (0 <= corr <= 1)
nFirms 25 Number of companies in the portfolio (<=250)
nPoints 3 Number of integration points (<=50)
Zeros Array containing zero curve: Maturities in the first column and zero rates in second column
HazardRates Array containing hazard rate curve: Maturities in column 1, hazard rates column 2
Function 27: CDO_UpFront(Life, Frequ, Recovery, Attach, Detach, Correlation, Spread, nFirms, nPoints, Zeros, Hazard
Calculates the breakeven upfront payment as a proportion of the notional for the CDO tranche
Arguments:
Life 5 Life of the CDS in years
Frequ 4 Frequency of payments on the CDS (=12, 4, 2, or 1)
Recovery 0.4 Recovery rate in the event of default (0<= R <=1)
Attach 0 Tranche attachment point (A >= 0)
Detach 0.03 Tranche detachment point (A < D <= 1)
Correlation 0.25 Copula Correlation (0 <= corr <= 1)
Spread 500 Spread in basis points that is paid in addition to the upfront payment
nFirms 50 Number of companies in the portfolio (<=250)
nPoints 5 Number of integration points (<=50)
Zeros Array containing zero curve: Maturities in the first column and zero rates in second column
HazardRates Array containing hazard rate curve: Maturities in column 1, hazard rates column 2
Function 27: ImplyCopulaCorrelation(Life, Frequ, Recovery, Attach, Detach, Spread, UpFront, nFirms, nPoints, Zeros,
Calculates the copula correlation that is consistent with a set of fee data
Arguments:
Life 5 Life of the CDS in years
Frequ 4 Frequency of payments on the CDS (=12, 4, 2, or 1)
Recovery 0.4 Recovery rate in the event of default (0<= R <=1)
Attach 0 Tranche attachment point (A >= 0)
Detach 0.03 Tranche detachment point (A < D <= 1)
Spread 500 Spread in basis points that is paid in addition to the upfront payment
UpFront 0.32 Upfront payment as proportion of notional
nFirms 25 Number of companies in the portfolio (<=250)
Page 29
CDO functions
Function 28: CDO_Value(Life, Frequ, Recovery, Attach, Detach, Correlation, Spread, UpFront, nFirms, nPoints, Zeros,
Calculates the value of the CDO tranche per $100 of notional
Arguments:
Life 5 Life of the CDS in years
Frequ 4 Frequency of payments on the CDS (=12, 4, 2, or 1)
Recovery 0.4 Recovery rate in the event of default (0<= R <=1)
Attach 0 Tranche attachment point (A >= 0)
Detach 0.03 Tranche detachment point (A < D <= 1)
Correlation 0.25 Copula Correlation (0 <= corr <= 1)
Spread 500 Spread in basis points that is paid in addition to the upfront payment
UpFront 0.32 Upfront payment as proportion of notional
nFirms 25 Number of companies in the portfolio (<=250)
nPoints 3 Number of integration points (<=50)
Zeros Array containing zero curve: Maturities in the first column and zero rates in second column
HazardRates Array containing hazard rate curve: Maturities in column 1, hazard rates column 2
Page 30
CDO functions
Term Structure
nd zero rates in second column 0 3.000%
hazard rates column 2 0.5 3.353%
1 3.664%
1.5 3.938%
2 4.180%
2.5 4.394%
ead, nFirms, nPoints, Zeros, HazardRates) 3 4.583%
3.5 4.749%
4 4.896%
4.5 5.026%
5 5.140%
5.5 5.241%
6 5.331%
6.5 5.409%
7 5.479%
7.5 5.540%
8 5.594%
8.5 5.642%
nd zero rates in second column 9 5.684%
hazard rates column 2 9.5 5.721%
10 5.754%
Page 31
CDO functions
50;K15:L35;K5:L10)
Page 32