27
M.A.D. Trading System A Mathematical HFT Setup Created and Developed by: Leonardo URBANO Copyright © 2014 Leonardo Urbano. All rights re

MAD Trading System

Embed Size (px)

Citation preview

Page 1: MAD Trading System

M.A.D. Trading SystemA Mathematical HFT Setup

Created and Developed by: Leonardo URBANO

Copyright © 2014  Leonardo Urbano.  All rights reserved.

Page 2: MAD Trading System

Agenda

Introduction: a bit of theory The idea: how M.A.D. is built and how it works MATLAB Code P&L Sample Transaction Costs Performance Conclusions and Considerations

Copyright © 2014  Leonardo Urbano.  All rights reserved.

M.A.D. Trading System – A Mathematical HFT Setup

Page 3: MAD Trading System

Basics

Copyright © 2014  Leonardo Urbano.  All rights reserved.

M.A.D. Trading System – A Mathematical HFT Setup

Page 4: MAD Trading System

Backgrounds

M.A.D. (Moving Average of Derivatives) was born starting from a Lawrence G. McMillian strategy

It is based on a Volatility Derivative and its underlying M.A.D. comes out from a Multifactorial Model A Long (Short) Underlying Position is opened (closed) daily,

according to algorithm’s signals A Put Option is Sold (Bought) according to trading position

kept on underlying Furthermore, we assume: Monthly Option, ATM, Infinitively

quantity purchasable Copyright © 2014  Leonardo Urbano.  All rights reserved.

M.A.D. Trading System – A Mathematical HFT Setup

Page 5: MAD Trading System

The VIX (and similars)

VIX is the volatility of a variance swap and not that of a volatility swap (volatility being the square root of variance, or standard deviation). A variance swap can be perfectly statically replicated through vanilla puts and calls whereas a volatility swap requires dynamic hedging. The VIX is the square root of the risk-neutral expectation of the S&P 500 variance over the next 30 calendar days.

Copyright © 2014  Leonardo Urbano.  All rights reserved.

M.A.D. Trading System – A Mathematical HFT Setup

Page 6: MAD Trading System

Multifactorial Model

Daily data 15 years back-testing

horizon Polynomial Functions Buy or sell Signals

M.A.D. Trading System – A Mathematical HFT Setup

Page 7: MAD Trading System

Algorithm Performance Analysis

Standard & Poor’s 500 vs. VIXEuroStoxx 50 vs. VSTOXXDax 30 vs. VDAX-NEW

Copyright © 2014  Leonardo Urbano.  All rights reserved.

M.A.D. Trading System – A Mathematical HFT Setup

Page 8: MAD Trading System

An overview of MATLAB Code

• Data Fetching• Making the Fit

• Standardized Data

• Bisquare for Robust Error

• Adjusted R2 as goodness

• Polynomial Function

Copyright © 2014  Leonardo Urbano.  All rights reserved.

M.A.D. Trading System – A Mathematical HFT Setup

Page 9: MAD Trading System

An overview of MATLAB Code - Continued

• Data Destandardization• Calculation of Indicators• Analyzing Calculated

Data

Copyright © 2014  Leonardo Urbano.  All rights reserved.

M.A.D. Trading System – A Mathematical HFT Setup

Page 10: MAD Trading System

GUI Implementation

Copyright © 2014  Leonardo Urbano.  All rights reserved.

M.A.D. Trading System – A Mathematical HFT Setup

Page 11: MAD Trading System

P&L Sample

Copyright © 2014  Leonardo Urbano.  All rights reserved.

M.A.D. Trading System – A Mathematical HFT Setup

Page 12: MAD Trading System

S&P’s 500 Options Transaction Costs

1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 20130.00%

0.50%

1.00%

1.50%

2.00%

2.50%

3.00%

1.44% 1.48%1.58%

0.38%

0.69%

0.04%

0.79%

1.14%

2.84%

1.68%

2.82%

0.61%

1.45%

0.22%

1.75%

As Percentage of Profit/Loss Copyright © 2014  Leonardo Urbano.  All rights reserved.

M.A.D. Trading System – A Mathematical HFT Setup

Page 13: MAD Trading System

EuroStoxx 50 Options Transaction Costs

As Percentage of Profit/Loss Copyright © 2014  Leonardo Urbano.  All rights reserved.

M.A.D. Trading System – A Mathematical HFT Setup

1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 20130.00%

0.50%

1.00%

1.50%

2.00%

2.50%

3.00%

3.50%

4.00%

4.50%

1.22%

0.72%

1.28%

2.56% 2.46%

1.05%

1.74%

2.58%2.23%

1.49%

1.13%1.31%

0.87%1.03%

4.21%

Page 14: MAD Trading System

DAX 30 Options Transaction Costs

As Percentage of Profit/Loss Copyright © 2014  Leonardo Urbano.  All rights reserved.

M.A.D. Trading System – A Mathematical HFT Setup

1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 20130.00%

0.50%

1.00%

1.50%

2.00%

2.50%

3.00%

3.50%

4.00%

4.50%

1.82%

3.93%

1.02%

3.38%

0.76%

2.57%

0.82%

0.45%

2.57%2.91%

0.80% 0.80% 0.71%

1.39%

2.04%

Page 15: MAD Trading System

S&P’s 500 Performance

Underlying Performances Derivatives Performance

Copyright © 2014  Leonardo Urbano.  All rights reserved.

M.A.D. Trading System – A Mathematical HFT Setup

1999

2001

2003

2005

2007

2009

2011

2013

-50%-40%-30%-20%-10%

0%10%20%30%40%

S&P's F'(x) F''(x) MA(5)

1999

2001

2003

2005

2007

2009

2011

2013

-50%-40%-30%-20%-10%

0%10%20%30%40%50%

Stand Alone Cumulative with MA(5)

Page 16: MAD Trading System

EuroStoxx 50 Performance

Underlying Performances Derivatives Performance

Copyright © 2014  Leonardo Urbano.  All rights reserved.

M.A.D. Trading System – A Mathematical HFT Setup

1999

2001

2003

2005

2007

2009

2011

2013

-80%

-60%

-40%

-20%

0%

20%

40%

60%ESXX50 F'(x) F''(x) MA(5)

1999

2001

2003

2005

2007

2009

2011

2013

-30%-20%-10%

0%10%20%30%40%50%60%

Stand Alone Cumulative with MA(5)

Page 17: MAD Trading System

Dax 30 Performance

Underlying Performances Derivatives Performance

Copyright © 2014  Leonardo Urbano.  All rights reserved.

M.A.D. Trading System – A Mathematical HFT Setup

1999

2001

2003

2005

2007

2009

2011

2013

-80%

-60%

-40%

-20%

0%

20%

40%

60%DAX30 F'(x) F''(x) MA(2)

1999

2001

2003

2005

2007

2009

2011

2013

-60.00%

-40.00%

-20.00%

0.00%

20.00%

40.00%

60.00%

80.00%Stand Alone Cumulative with MA(2)

Page 18: MAD Trading System

Copyright © 2014  Leonardo Urbano.  All rights reserved.

M.A.D. Trading System – A Mathematical HFT Setup

  S&P's F'(x) F''(x) MA(5) Stand Alone Cumulative with MA(5)TOTAL 69.07% 63.80% -29.78% 26.02% Performance 240.26% 266.29%

    -5.27% -98.85% -43.05% Vs. S&P's 500 171.19% 197.22%Volatility 19.11% 14.34% 18.92% 11.60%   18.92% 20.48%

Max 29.60% 22.97% 34.52% 20.39% Vs. S&P's 500 42.48% 39.17%Min -38.47% -23.80% -30.94% -15.10% Vs. S&P's 500 -38.35% -43.20%

  DAX30 F'(x) F''(x) MA(2) Stand Alone Cumulative with MA(2)TOTAL 122.86% -36.34% -157.67% -14.70% Performance 275.21% 260.52%

    -159.20% -280.53% -137.56% Vs. DAX30 152.35% 137.66%Volatility 26.99% 21.80% 18.88% 15.89%   15.42% 26.48%

Max 38.98% 23.45% 15.66% 19.37% Vs. DAX30 43.65% 63.02%Min -43.94% -44.03% -63.06% -34.71% Vs. DAX30 -3.84% -38.55%

  ESXX50 F'(x) F''(x) MA(5) Stand Alone Cumulative with MA(5)TOTAL 37.92% -12.39% -42.75% 72.60% Performance 264.78% 337.39%

    -50.31% -80.67% 34.68% Vs. ESXX50 226.86% 299.47%Volatility 24.16% 19.78% 23.96% 13.70%   15.69% 19.20%

Max 46.74% 31.15% 28.21% 27.59% Vs. ESXX50 43.74% 50.28%Min -44.37% -53.14% -61.91% -12.23% Vs. ESXX50 -17.13% -4.73%

Page 19: MAD Trading System

Cumulative Returns S&P’s 500

Copyright © 2014  Leonardo Urbano.  All rights reserved.

M.A.D. Trading System – A Mathematical HFT Setup

1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 20130

200

400

600

800

1000

1200

1400

1600

1800F'(x) F''(x) MA(5) Stand Alone Cumulative with MA(5)

Page 20: MAD Trading System

Cumulative Returns EuroStoxx 50

Copyright © 2014  Leonardo Urbano.  All rights reserved.

M.A.D. Trading System – A Mathematical HFT Setup

1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 20130

200

400

600

800

1000

1200

1400

1600

1800

2000F'(x) F''(x) MA(5) Stand Alone Cumulative with MA(5)

Page 21: MAD Trading System

Cumulative Returns DAX 30

Copyright © 2014  Leonardo Urbano.  All rights reserved.

M.A.D. Trading System – A Mathematical HFT Setup

1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 20130

200

400

600

800

1000

1200F'(x) F''(x) MA(2) Stand Alone Cumulative with MA(5)

Page 22: MAD Trading System

A Market distortion

1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013

-100.00%

-90.00%

-80.00%

-70.00%

-60.00%

-50.00%

-40.00%

-30.00%

-20.00%

-10.00%

0.00%

S&P's 500 vs. VIX Annual Correlation

Corr

elat

ion

Copyright © 2014  Leonardo Urbano.  All rights reserved.

M.A.D. Trading System – A Mathematical HFT Setup

Page 23: MAD Trading System

A Market distortion - Continued

Copyright © 2014  Leonardo Urbano.  All rights reserved.

M.A.D. Trading System – A Mathematical HFT Setup

1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013

-100.00%

-80.00%

-60.00%

-40.00%

-20.00%

0.00%

20.00%

Eurostoxx 50 vs. VSTOXX Annual Correlation

Corr

elat

ion

Page 24: MAD Trading System

A Market distortion – Continued

Copyright © 2014  Leonardo Urbano.  All rights reserved.

M.A.D. Trading System – A Mathematical HFT Setup

1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013

-120.00%

-100.00%

-80.00%

-60.00%

-40.00%

-20.00%

0.00%

20.00%

40.00%

60.00%

DAX30 vs. VDAX-NEW Annual Correlation

Corr

elat

ion

Page 25: MAD Trading System

Conclusions

Copyright © 2014  Leonardo Urbano.  All rights reserved.

M.A.D. Trading System – A Mathematical HFT Setup

Page 26: MAD Trading System

Does M.A.D. Algorithm works?

Copyright © 2014  Leonardo Urbano.  All rights reserved.

M.A.D. Trading System – A Mathematical HFT Setup

Yes, it works! Anyway, some considerations must be done:

1. Correlation between VIX and Underlying over a wide time horizon: in years where markets soared the correlation between underlying and its volatility derivative modified (so strongly to become positive in some years!).

2. Volatility: it does not affect directly underlying performances but it affects directly the procedure fitting and, consequently, the goodness of algorithm’s signals.

3. MA: a moving average helps to faster change algorithm’s signal and exploit market swings.

4. Losses: even if strategy outputs are mostly positive, we must pay attention to the high recorded losses in particular years.

5. Goodness of Fit: attention must be paid when fitting process runs. In some years, especially in market crashes or in strong financial/economic crises, it is difficult to have a high R2 that reflects on lower algorithm performance

Page 27: MAD Trading System

Thank you for your attention!

Copyright © 2014  Leonardo Urbano.  All rights reserved.

M.A.D. Trading System – A Mathematical HFT Setup