CapeTools Generic MonteCarlo Pricer




Welcome | Documentation format | QuantTools Groups | QuantTools Categories | Licence

Key TAGs | Excel Index | API Index


http://www.QuantTools.com

In total there are 11 functions present within the CapeTools Generic MonteCarlo Pricer category of functions.


General Description


Functions to price generic Equity/FX/Commodity structures under a MonteCarlo framework. If your product's payoff does not refer to asset prices in the future (ie - Bermudan / American options) you can use this framework.

Here are some general rules to keep in mind regarding how the payoff grid will be processed :

  1. Rows are time points. As you read down the grid you are moving forward in time.
  2. Columns represent your payoff formulas. You can create as many columns as you like. Columns are there to help you split up your payoff, or for a payoff function within a cell to refer to other cells within the grid.
  3. For the MonteCarlo pricer, the pricing starts at the first timestep and prices from left to right.
  4. Formula expressions within a cell cannot refer to formula cells to the right of itself.
  5. Formula expressions within a cell cannot refer to formula cells below itself (future time points).


If you bear the 5 points in mind, this should aid you in constructing payoff grids.

Below is an example of a payoff table. The Step column is not required.


StepEventDateRepeat?PayOff ColPayOff ColPayOff ColPayOff Col
1#19/07/2005#FALSEAsset(1, cRow) + _a + 5pctAsset(2, cRow) + Interp1D(1,cRow) - 100bpGridRowAvg(cRow, cCol-2, cCol-1)
2#19/01/2006#FALSEAsset(1, cRow) + _a + 5pctAsset(2, cRow) + Interp1D(1,cRow) - 100bpGridRowAvg(cRow, cCol-2, cCol-1)
3#19/07/2006#FALSEAsset(1, cRow) + _a + 5pctAsset(2, cRow) + Interp1D(1,cRow) - 100bpGridRowAvg(cRow, cCol-2, cCol-1)
4#19/01/2007#FALSEAsset(1, cRow) + _a + 5pctAsset(2, cRow) + Interp1D(1,cRow) - 100bpGridRowAvg(cRow, cCol-2, cCol-1)
5#19/07/2007#FALSEAsset(1, cRow) + _a + 5pctAsset(2, cRow) + Interp1D(1,cRow) - 100bpGridRowAvg(cRow, cCol-2, cCol-1)
6#19/01/2008#FALSEAsset(1, cRow) + _a + 5pctAsset(2, cRow) + Interp1D(1,cRow) - 100bpGridRowAvg(cRow, cCol-2, cCol-1)
7#19/07/2008#FALSEAsset(1, cRow) + _a + 5pctAsset(2, cRow) + Interp1D(1,cRow) - 100bpGridRowAvg(cRow, cCol-2, cCol-1)
8#19/01/2009#FALSEAsset(1, cRow) + _a + 5pctAsset(2, cRow) + Interp1D(1,cRow) - 100bpGridRowAvg(cRow, cCol-2, cCol-1)
9#19/07/2009#FALSEAsset(1, cRow) + _a + 5pctAsset(2, cRow) + Interp1D(1,cRow) - 100bpGridRowAvg(cRow, cCol-2, cCol-1)
10#19/01/2010#FALSEAsset(1, cRow) + _a + 5pctAsset(2, cRow) + Interp1D(1,cRow) - 100bpGridRowAvg(cRow, cCol-2, cCol-1)
11#19/07/2010#FALSEAsset(1, cRow) + _a + 5pctAsset(2, cRow) + Interp1D(1,cRow) - 100bpGridRowAvg(cRow, cCol-2, cCol-1)
12#19/01/2011#FALSEAsset(1, cRow) + _a + 5pctAsset(2, cRow) + Interp1D(1,cRow) - 100bpGridRowAvg(cRow, cCol-2, cCol-1)max(GridColMin(cCol-1, 1, cRow) - AssetMin(1, 1, cRow), 0.0) * DCF(1, cRow)



The 'Repeat' column indicates that the instruction at the current step will be repeated for all the timesteps between this and the next.

Even though there are only 12 timesteps above, you can instruct the function to insert additional steps between each step.





Financial variables (case sensitive) :



Financial functions (case sensitive) :




Predefined functions (case sensitive) :



Predefined operators :



Predefined operators that can be used within the first parameter of the ite() or iff() function :


Some possible examples of what is possible now follow (Today = 19/07/2005):

Vanilla Option. (The Step column is not required).


StepEventDateRepeat?PayOff Col
1#19/07/2006#FALSEmax(Asset(1, cRow) - 10, 0) * DCF(1, cRow)



Two Vanilla Options (Call and Put). (The Step column is not required).


StepEventDateRepeat?PayOff ColPayOff ColPayOff Col
1#19/07/2006#FALSE100max(Asset(1, cRow) - Cell(cRow, cCol-1), 0) * DCF(1, cRow)
2#19/07/2007#FALSE90max(Cell(cRow, cCol-1) - Asset(1, cRow), 0) * DCF(1, cRow)GridColSum(cCol-1, 1, cRow)



Asian Lookback Option. (The Step column is not required).


StepEventDateRepeat?PayOff ColPayOff Col
1#19/07/2005#FALSEAsset(1, cRow)
2#19/01/2006#FALSEAsset(1, cRow)
3#19/07/2006#FALSEAsset(1, cRow)
4#19/01/2007#FALSEAsset(1, cRow)
5#19/07/2007#FALSEAsset(1, cRow)max(GridColAvg(cCol-1, 1, cRow) - GridColMax(cCol-1, 1, cRow), 0) * DCF(1, cRow)



Asian Option with fixed strike. (The Step column is not required).


StepEventDateRepeat?PayOff ColPayOff Col
1#19/07/2005#FALSEAsset(1, cRow)
2#19/01/2006#FALSEAsset(1, cRow)
3#19/07/2006#FALSEAsset(1, cRow)
4#19/01/2007#FALSEAsset(1, cRow)
5#19/07/2007#FALSEAsset(1, cRow)max(GridColAvg(cCol-1, 1, cRow) - 10, 0) * DCF(1, cRow)



Asian Option with fixed strike (daily averaging). (The Step column is not required).


StepEventDateRepeat?PayOff Col
1#19/07/2005#TRUE
2#19/01/2006#TRUE
3#19/07/2006#TRUE
4#19/01/2007#TRUE
5#19/07/2007#FALSEmax(AssetAvg(1, 1, cRow) - 10, 0) * DCF(1, cRow)



Asian Option with floating strike. (The Step column is not required).


StepEventDateRepeat?PayOff ColPayOff Col
1#19/07/2005#FALSEAsset(1, cRow)
2#19/01/2006#FALSEAsset(1, cRow)
3#19/07/2006#FALSEAsset(1, cRow)
4#19/01/2007#FALSEAsset(1, cRow)
5#19/07/2007#FALSEAsset(1, cRow)max(GridColAvg(cCol-1, 1, cRow) - Cell(cRow, cCol), 0) * DCF(1, cRow)



Asian Option with floating strike (daily averaging). (The Step column is not required).


StepEventDateRepeat?PayOff Col
1#19/07/2005#TRUE
2#19/01/2006#TRUE
3#19/07/2006#TRUE
4#19/01/2007#TRUE
5#19/07/2007#FALSEmax(AssetAvg(1, 1, cRow) - Cell(cRow, cCol), 0) * DCF(1, cRow)




Quanto Asian Basket Option with floating strike. (The Step column is not required).

This example was picked up from one of the QuantLib's mailing list (with some modifications).


Let us consider a quanto asian basket average rate option, which has as underlying 2 equities quoted in currencies AAA and BBB (the values are not "real word" data).

Underlying #1: current price = 75 AAA, dividend yield = 3.1%, volatility = 20%
Underlying #2: current price = 100 BBB, dividend yield = 2%, volatility = 15%

AAA risk free rate: 5.1%
BBB risk free rate: 3.5%
Exchange rate AAA/BBB: 1.5
Volatility of exchange rate AAA/BBB: 15%
Correlation between Underlying #2 and the exchange rate = 0.4

The option is paid in currency AAA and has the payoff of a quanto asian
Basket (note: in the payoff there is no exchange rate):

Basket1 = underlying1[samplingDate1] + underlying2[samplingDate1]
Basket2 = underlying1[samplingDate2] + underlying2[samplingDate2]
.
.
.
BasketN = underlying1[samplingDateN] + underlying2[samplingDateN]

Average = (basket1 + basket2 + ... + basketN) / N
Strike: 175
Sampling dates: 19/07/2005, 19/01/2006, 19/07/2006, 19/01/2007, 19/07/2007
Expiry date: 19/07/2007
Payoff at expiry = max(0; Average - Strike)

One can use the following payoff table :


StepEventDateRepeat?PayOff ColPayOff ColPayOff ColPayOff Col
1#19/07/2005#FALSEAsset(1, cRow)Asset(2, cRow)Cell(cRow, cCol-2)+Cell(cRow, cCol-1)
2#19/01/2006#FALSEAsset(1, cRow)Asset(2, cRow)Cell(cRow, cCol-2)+Cell(cRow, cCol-1)
3#19/07/2006#FALSEAsset(1, cRow)Asset(2, cRow)Cell(cRow, cCol-2)+Cell(cRow, cCol-1)
4#19/01/2007#FALSEAsset(1, cRow)Asset(2, cRow)Cell(cRow, cCol-2)+Cell(cRow, cCol-1)
5#19/07/2007#FALSEAsset(1, cRow)Asset(2, cRow)Cell(cRow, cCol-2)+Cell(cRow, cCol-1)max(GridColAvg(cCol-1, 1, cRow) - 175, 0) * DCF(1, cRow)




In terms of the assets themselves, we would construct a CorrArrayProcesses() object and fill it with just 2 process objects created via the GBSProcess() function.
The correlation matrix used in the simulation is consequently just 2x2 and has only the correlations between the assets.

For the first process, GBSProcess(), we would consider the following arguments.




However for the second process, GBSProcess(), we would consider the following arguments.




Thus the Rate value for the second process will equal : 0.035 - (0.4 * 0.15 * 0.15).


The reason why the second process's rate value is modified is because the currency of this asset is not equal to the payment currency. If you do not want to use a FX rate in the expression then a Quanto adjustment must be made to the 'rate' parameter. You also see that we use the DCF(1, cRow) function within the payoff table. The first parameter indicates which asset's discounting curve are we using. In this case, Asset #1's discounting curve.


When pricing Quanto products, there is no need to construct another process object to simulate the exchange rate.




Function list.

Copyright (c) 2003-2007 CapeTools - All Rights Reserved.