No BSD License  

Highlights from
Visualize dynamic hedging

4.0

4.0 | 1 rating Rate this file 18 Downloads (last 30 days) File Size: 253.37 KB File ID: #18498
image thumbnail

Visualize dynamic hedging

by Dimitri Shvorob

 

28 Jan 2008 (Updated 29 Jan 2008)

(via an interactive GUI)

| Watch this File

File Information
Description

Function HEDGEDEMO aims to help students and instructors of finance visualize trading demands of simple static or dynamic value-hedging strategies. In a single-factor setting, 2-asset hedge portfolios are constructed to match, at a point in time, value and delta of the hedged portfolio, consisting of 1-2 assets, one unit of each. (Delta is estimated by shifting the factor path by +/- 0.01). Factor dynamics are described by a Matlab expression or function that defines vector 'X' in terms of vector 'T', where T = StartDate:EndDate. With 'X' defined and evaluated, paths of asset prices are similarly given by Matlab expressions or functions inputting 'X' and 'T'.

Required Products Financial Toolbox
MATLAB release MATLAB 7.4 (R2007a)
Other requirements Built-in examples/defaults call functions of Financial Toolbox; these can be replaced with arbitrary alternatives.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
30 Jan 2008 Olivier B.

Hi,
I got an error when pressing Go, after having generated the time series :
"
??? Index exceeds matrix dimensions.

Error in ==> hedgedemo>changeHedgeAssetSeries/changeHedgeValueSeries at 411
        tradeValue = tradeQuant.*aPrice(3:4,:);

Error in ==> hedgedemo>changeHedgeAssetSeries at 370
    changeHedgeValueSeries

Error in ==> hedgedemo>fillFrame41/addFreqPanel/constructHedge at 184
            changeHedgeAssetSeries

??? Error while evaluating uicontrol Callback
"

and sometimes
"
Warning: Matrix is singular, close to singular or badly scaled.
         Results may be inaccurate. RCOND = NaN.
> In hedgedemo>changeHedgeAssetSeries/changeHedgeQuantSeries at 379
  In hedgedemo>changeHedgeAssetSeries at 369
  In hedgedemo>fillFrame41/addFreqPanel/constructHedge at 184
??? Index exceeds matrix dimensions.
"

It does that, even when using inputs displayed on the jpg example.
Do you have an idea ?

30 Jan 2008 Dimitri Shvorob

Ouch :( Thank you for the report, Olivier, I'll look into this. The singularity warning, however, may be legitimate: we find the quantities by solving Aq = b, where A packs prices and deltas, and A can have short rank.

23 Aug 2011 Ning  
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
finance Dimitri Shvorob 22 Oct 2008 09:45:09
modeling Dimitri Shvorob 22 Oct 2008 09:45:09
analysis Dimitri Shvorob 22 Oct 2008 09:45:09
gui Dimitri Shvorob 22 Oct 2008 09:45:09
financial modeling Dimitri Shvorob 22 Oct 2008 09:45:09
hedgedemo Dimitri Shvorob 22 Oct 2008 09:45:09
dynamic hedging Dimitri Shvorob 22 Oct 2008 09:45:09
hedgedemo Eduardo 01 Oct 2011 05:46:13

Contact us at files@mathworks.com