Assignment 2/3 Details
Instrument Defintions
Equity
An equity is a fancy name for a stock traded on a stock market.
Stocks tend to go up and down in a fixed relationship to
the equity index corresponding to the market in which the stock trades.
name | string | the unique name of this instrument
|
currency | char(3) | the market in which this equity trades
|
price | real | the current market price of this equity
|
volatility | percent | the current market volatility of this equity
|
beta | real | the beta w.r.t. its market's major equity index (as defined by currency).
|
Zero Coupon Bond
A zero coupon bond is a bond with a certain face value, say $100,
that you can buy and sell over-the-counter at its current price
(which is often not $100).
At the bond's maturity date (and not before), the holder of the bond gets
back their $100 plus interest (say 10%), which would be $110.
For a given zero coupon bond, the amount of interest is independent
of the term to maturity.
name | string | the unique name of this instrument
|
currency | char(3) | the currency in which this bond is denominated
|
maturity | real | years until maturity
|
facevalue | real | the face value of this bond
|
interest | percent | the simple interest paid over the facevalue at maturity
|
European Equity Call Option
A European Equity Call Option is a more precise name for a certain type of stock option.
This piece of paper gives the holder the option to purchase a certain number of
shares of the underlying stock at a specific strike price at maturity of the option
(and only then).
If the underlying stock is trading higher than that price, the holder of the option
has made money.
If the underlying stock is trading lower or at that price, the option has no value
(under this circumstance, the holder would be foolish to exercise the option).
The valuation of an option depends heavily upon the volatility of the underlying stock.
name | string | the unique name of this instrument
|
currency | char(3) | the currency in which this option is denominated
|
maturity | real | years to maturity
|
amount | int | the number of shares optioned
|
underlier | string | the name of the underlying (equity) instrument
|
strike | real | the strike price for this option
|
Foreign Exchange Forward Contract
A Foreign Exchange Forward Contract is an agreement between two parties
to exchange currencies at a preset exchange rate at a specific point in
the future.
If at that future point the exchange rate is anything other
than the contracted rate, then one side will lose money and
the other will make money.
Note that the way we define this contract is consistent with the
other things we are doing, but is not market standard.
Here, the contract carries with it the obligation to
exchange 'amount' of domestic currency for foreign currency
at the exchange rate 'strike' at maturity.
The forward exchange rate is quoted as the number of units of foreign currency
per unit of domestic currency.
The valuation formulae below will return the value in 'domestic' currency.
name | string | the unique name of this instrument
|
currency | string | the domestic currency
|
maturity | real | years to maturity
|
amount | int | the number of units of the domestic currency
|
foreign | char(3) | the foreign currency
|
strike | real | the contracted forward exchange rate (foreign/domestic) at maturity
|
Market Data
Foreign Exchange Rates
Foreign exchange rates are given for each of the various currencies supported
with respect to the value of the Canadian dollar.
Currencies are represented by their 3 character (all caps)
ISO 4217 (Reuters) code.
All foreign exchange rates a reported as # units of foreign currency
per Canadian dollar.
CAD | Canadian dollar | 1.00
|
EUR | European Union euro | 0.7841
|
GBP | United Kingdom pound | 0.4547
|
THB | Thai bhat | 28.769
|
USD | United States dollar | 0.6579
|
ZAR | South African rand | 5.0736
|
JPY | Japanese yen | 70.872
|
Interest Rates
Interest rates are expressed as a curve with certain
points specified, and linear interpolation between the points.
Each independently floating currency has its own independent
interest rate curve.
Interest rates are denominated in units of
annualized rates, continuously compounded, on an ACT/ACT daycount basis.
In the system and in the datafile, all terms are given in
units of years (assuming an ACT/ACT daycount).
A sample (fictitious) curve is shown here.
1 day | 7.5%
|
5 day | 7.5%
|
1 month | 7.45%
|
3 month | 7.35%
|
6 month | 7.3%
|
1 year | 7.2%
|
3 year | 7.1%
|
5 year | 7.0%
|
10 year | 7.0%
|
30 year | 7.0%
|
Market Indices
Usually associated with each currency is a major stock market index.
Various indeces are listed below
CAD | TSE300 | 9926.78
|
EUR | DAX30 | 6483.00
|
GBP | FTSE100 | 6148.2
|
THB | SET | 268.18
|
USD | S&P500 | 1342.12
|
ZAR | JAS | 7792.9
|
JPY | Nikkei225 | 14872.48
|
Valuation Models
Use the following valuation methods.
Instrument Type | pricing method | sample code
|
Zero Coupon Bond | zero curve pricing | Java
|
Equity | CAPM | Java
|
Forex Forward | IR parity | Java
|
Equity Option | Black-Scholes | Java
|
Note that we use only units of years from today (the implicit valuation date),
so no complex date arithmetic is required.
In the sample code, "r" (the interest rate) is a simple scalar parameter.
You will need to lookup "r" on the appropriate interest rate curve.
File Format
The file is an ASCII XML format.
Please find an example
here.
The grammer for the file is given by its
Document Type Definitions.
The portfolio hierarchy is specified using the 'holds' tag,
whether what is held is a portfolio or an instrument.
Therefore the 'amount' tag is optional, and if absent defaults to 1
(this is intended for the portfolio holds portfolio case).
It is my intent that only leaf portfolios hold positions in instruments,
all other portfolios holding 1 unit of other portfolios only.
There is no specific ordering implied by the DTD,
and the various bits can come in any order.
Therefore do not expect that an object will have been parsed
before a reference to it is read in.
To parse the files, you can try using the project-X parser supplied by Sun
as part of its
JAXP (Java API for XML Parsing) package.
Either that or just parse the file yourself (it's easy to parse).
You probably would not want to use the DOM part of JAXP
as the assignment specification states that you may have 100's of 1000's of
scenarios, and the object model created by DOM would be huge.
If you choose to use JAXP, a better bet is to hook into the SAX (Simple API for XML)
classes directly, and create your own objects as the parsing proceeds.