trend-following in financial markets matlab expo 2014-05

33
Trend-following in Financial Markets MATLAB EXPO 2014-05-22 Andreas Bernsel

Upload: others

Post on 18-Feb-2022

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Trend-following in Financial Markets MATLAB EXPO 2014-05

Trend-following in Financial Markets

MATLAB EXPO

2014-05-22

Andreas Bernsel

Page 2: Trend-following in Financial Markets MATLAB EXPO 2014-05

Agenda

- What is Lynx?

- How do futures contracts work?

- What is trend following?

- Are there any trends to follow?

- A simple univariate example

- What about covariance?

- How is MATLAB used at Lynx?

Page 3: Trend-following in Financial Markets MATLAB EXPO 2014-05

Lynx Asset Management

Model-based trading

Holding period ≥ a few days (usually)

~40 people

Mostly trend following strategies

≈ 60 most liquid futures world-wide

Asset classes:

Equity indicies

Fixed income

Currencies

Commodities

~4.8bn USD under management

Partly owned by Brummer & Partners (9 funds, ~17bn USD in total)

Page 4: Trend-following in Financial Markets MATLAB EXPO 2014-05

Agenda

- What is Lynx?

- How do futures contracts work?

- What is trend following?

- Are there any trends to follow?

- A simple univariate example

- What about covariance?

- How is MATLAB used at Lynx?

Page 5: Trend-following in Financial Markets MATLAB EXPO 2014-05

Pri

ce

Sep 16th

Okay!

Now

I will buy 1,000 barrelsof oil from you on Sep16th for per barrel. $106

A business agreement

Mr Long

Mr Short

Page 6: Trend-following in Financial Markets MATLAB EXPO 2014-05

Pri

ceNow

Acc

um

ula

ted

valu

e

I will buy 1,000 barrelsof oil from you on Sep16th for per barrel. $106

A business agreement

Sep 16th

Okay!

Mr Long

Mr Short

Page 7: Trend-following in Financial Markets MATLAB EXPO 2014-05

I will buy 1,000 barrelsof oil from you on Sep16th for per barrel.

Okay!

Pri

ce c

han

gesi

nce

yest

erd

ay

$

$106$107

Futures contracts

Mr Long

Mr Short

Page 8: Trend-following in Financial Markets MATLAB EXPO 2014-05

Okay!

Pri

ce c

han

gesi

nce

yest

erd

ay

$

I will buy 1,000 barrelsof oil from you on Sep16th for per barrel. $106.5$107

Futures contracts

Mr Long

Mr Short

Page 9: Trend-following in Financial Markets MATLAB EXPO 2014-05

Okay!

Pri

ce c

han

gesi

nce

yest

erd

ay

$

I will buy 1,000 barrelsof oil from you on Sep16th for per barrel. $106.3$106.5

Futures contracts

Mr Long

Mr Short

Page 10: Trend-following in Financial Markets MATLAB EXPO 2014-05

Okay!

Pri

ce c

han

gesi

nce

yest

erd

ay

$

I will buy 1,000 barrelsof oil from you on Sep16th for per barrel. $106.3$106.8

Futures contracts

Mr Long

Mr Short

Page 11: Trend-following in Financial Markets MATLAB EXPO 2014-05

Okay!

Pri

ce c

han

gesi

nce

yest

erd

ay

$

I will buy 1,000 barrelsof oil from you on Sep16th for per barrel. $106.8$105.7

Futures contracts

Mr Long

Mr Short

Page 12: Trend-following in Financial Markets MATLAB EXPO 2014-05

Okay!

Pri

ce c

han

gesi

nce

yest

erd

ay

I will buy 1,000 barrelsof oil from you on Sep16th for per barrel. $105.7$108

- Contract value is always zero (after mark-to-market)- Allows for exposure without investing in the underlying asset- Allows for leverage

Futures contracts

Mr Long

Mr Short

Page 13: Trend-following in Financial Markets MATLAB EXPO 2014-05

Agenda

- What is Lynx?

- How do futures contracts work?

- What is trend following?

- Are there any trends to follow?

- A simple univariate example

- What about covariance?

- How is MATLAB used at Lynx?

Page 14: Trend-following in Financial Markets MATLAB EXPO 2014-05

Trend following in principle

Page 15: Trend-following in Financial Markets MATLAB EXPO 2014-05

Agenda

- What is Lynx?

- How do futures contracts work?

- What is trend following?

- Are there any trends to follow?

- A simple univariate example

- What about covariance?

- How is MATLAB used at Lynx?

Page 16: Trend-following in Financial Markets MATLAB EXPO 2014-05

Block size

2

1

0

-1

-2

Retu

rn(s

td.

de

v.)

Are there any trends to follow?

- Accumulated returns of block size 1-50

- Autocorrelation of lag 1

- 51 futures markets from 1980-2014

Page 17: Trend-following in Financial Markets MATLAB EXPO 2014-05

Are there any trends to follow? Actual returns

Permuted returns

(mean and std. dev. over 100 simulations)

±1 std.

How does the autocorrelation structure change over time?

Page 18: Trend-following in Financial Markets MATLAB EXPO 2014-05

Agenda

- What is Lynx?

- How do futures contracts work?

- What is trend following?

- Are there any trends to follow?

- A simple univariate example

- What about covariance?

- How is MATLAB used at Lynx?

Page 19: Trend-following in Financial Markets MATLAB EXPO 2014-05

A simple trend model

2

1

0

-1

-2

Retu

rn(s

td.

de

v.)

Weig

ht

* ’

Page 20: Trend-following in Financial Markets MATLAB EXPO 2014-05

A simple trend model

Page 21: Trend-following in Financial Markets MATLAB EXPO 2014-05

The diversification effect

Profits from a trading strategy in two assets:

What is the best way to invest 2 units?

a) Portfolio P = 2𝑋:

b) Portfolio Q = 𝑋 + 𝑌:

Information ratio:

Page 22: Trend-following in Financial Markets MATLAB EXPO 2014-05

Agenda

- What is Lynx?

- How do futures contracts work?

- What is trend following?

- Are there any trends to follow?

- A simple univariate example

- What about covariance?

- How is MATLAB used at Lynx?

Page 23: Trend-following in Financial Markets MATLAB EXPO 2014-05

PCA of market returns

How do the principal components change over time?

Page 24: Trend-following in Financial Markets MATLAB EXPO 2014-05

Agenda

- What is Lynx?

- How do futures contracts work?

- What is trend following?

- Are there any trends to follow?

- A simple univariate example

- What about covariance?

- How is MATLAB used at Lynx?

Page 25: Trend-following in Financial Markets MATLAB EXPO 2014-05

How is MATLAB used at Lynx?

- Model development and backtesting

- 128-core MATLAB cluster used for stability tests, etc.

- Data import using .NET-interface to in-house database client

- Data verification and quality projects

- .NET-assemblies used in production for a few models

- Monitoring of positions and results for individual models

Page 26: Trend-following in Financial Markets MATLAB EXPO 2014-05

How is MATLAB used at Lynx?

- Model development and backtesting

- 128-core MATLAB cluster used for stability tests, etc.

- Data import using .NET-interface to in-house database client

- Data verification and quality projects (MATLAB GUI:s)

- .NET-assemblies used in production for a few models

$

- Prototyping ideas for new trading models

- Backtesting on historical data

- Walk-forward parameter estimation to minimize risk of

overfitting

Page 27: Trend-following in Financial Markets MATLAB EXPO 2014-05

How is MATLAB used at Lynx?

- Model development and backtesting

- 128-core MATLAB cluster used for stability tests, etc.

- Data import using .NET-interface to in-house database client

- Data verification and quality projects (MATLAB GUI:s)

- MATLAB generated .NET-assemblies used in production for a few models

- Monitoring of positions and results for individual models

Page 28: Trend-following in Financial Markets MATLAB EXPO 2014-05

How is MATLAB used at Lynx?

Ubuntu cluster

License server

Scheduler

1

16

- Almost exclusively using parfor

- Computationally expensive models

(Parallelization e.g. over contracts)

- Stability tests (Parallelization over

parameter instances)

Page 29: Trend-following in Financial Markets MATLAB EXPO 2014-05

How is MATLAB used at Lynx?

Page 30: Trend-following in Financial Markets MATLAB EXPO 2014-05

How is MATLAB used at Lynx?

- Model development and backtesting

- 128-core MATLAB cluster used for stability tests, etc.

- Data import using .NET-interface to in-house database client

- Data verification and quality projects

- MATLAB generated .NET-assemblies used in production for a few models

- Monitoring of positions and results for individual models

.NET-

assembly

Excel

client

Price

DB

Page 31: Trend-following in Financial Markets MATLAB EXPO 2014-05

How is MATLAB used at Lynx?

- Model development and backtesting

- 128-core MATLAB cluster used for stability tests, etc.

- Data import using .NET-interface to in-house database client

- Data verification and quality projects

- MATLAB generated .NET-assemblies used in production for a few models

- Monitoring of positions and results for individual models

Page 32: Trend-following in Financial Markets MATLAB EXPO 2014-05

How is MATLAB used at Lynx?

- Model development and backtesting

- 128-core MATLAB cluster used for stability tests, etc.

- Data import using .NET-interface to in-house database client

- Data verification and quality projects (MATLAB GUI:s)

- MATLAB generated .NET-assemblies used in production for a few models

- Monitoring of positions and results for individual models

Page 33: Trend-following in Financial Markets MATLAB EXPO 2014-05

Thank you!