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.
namestringthe unique name of this instrument
currencychar(3)the market in which this equity trades
pricerealthe current market price of this equity
volatilitypercentthe current market volatility of this equity
betarealthe 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.
namestringthe unique name of this instrument
currencychar(3)the currency in which this bond is denominated
maturityrealyears until maturity
facevaluerealthe face value of this bond
interestpercentthe 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.
namestringthe unique name of this instrument
currencychar(3)the currency in which this option is denominated
maturityrealyears to maturity
amountintthe number of shares optioned
underlierstringthe name of the underlying (equity) instrument
strikerealthe 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.
namestringthe unique name of this instrument
currencystringthe domestic currency
maturityrealyears to maturity
amountintthe number of units of the domestic currency
foreignchar(3)the foreign currency
strikerealthe 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.
CADCanadian dollar1.00
EUREuropean Union euro0.7841
GBPUnited Kingdom pound 0.4547
THBThai bhat28.769
USDUnited States dollar0.6579
ZARSouth African rand5.0736
JPYJapanese yen70.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 day7.5%
5 day7.5%
1 month7.45%
3 month7.35%
6 month7.3%
1 year7.2%
3 year7.1%
5 year7.0%
10 year7.0%
30 year7.0%

Market Indices

Usually associated with each currency is a major stock market index. Various indeces are listed below
CADTSE3009926.78
EURDAX306483.00
GBPFTSE1006148.2
THBSET268.18
USDS&P5001342.12
ZARJAS7792.9
JPYNikkei22514872.48

Valuation Models

Use the following valuation methods.
Instrument Typepricing methodsample code
Zero Coupon Bondzero curve pricingJava
EquityCAPMJava
Forex ForwardIR parityJava
Equity OptionBlack-ScholesJava
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.