Trend-following in Financial Markets MATLAB EXPO 2014-05 ...
Transcript of Trend-following in Financial Markets MATLAB EXPO 2014-05 ...
![Page 1: Trend-following in Financial Markets MATLAB EXPO 2014-05 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/1.jpg)
Trend-following in Financial Markets
MATLAB EXPO
2014-05-22
Andreas Bernsel
![Page 2: Trend-following in Financial Markets MATLAB EXPO 2014-05 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/2.jpg)
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 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/3.jpg)
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 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/4.jpg)
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 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/5.jpg)
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 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/6.jpg)
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 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/7.jpg)
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 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/8.jpg)
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 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/9.jpg)
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 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/10.jpg)
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 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/11.jpg)
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 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/12.jpg)
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 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/13.jpg)
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 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/14.jpg)
Trend following in principle
![Page 15: Trend-following in Financial Markets MATLAB EXPO 2014-05 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/15.jpg)
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 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/16.jpg)
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 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/17.jpg)
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 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/18.jpg)
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 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/19.jpg)
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 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/20.jpg)
A simple trend model
![Page 21: Trend-following in Financial Markets MATLAB EXPO 2014-05 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/21.jpg)
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 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/22.jpg)
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 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/23.jpg)
PCA of market returns
How do the principal components change over time?
![Page 24: Trend-following in Financial Markets MATLAB EXPO 2014-05 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/24.jpg)
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 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/25.jpg)
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 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/26.jpg)
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 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/27.jpg)
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 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/28.jpg)
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 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/29.jpg)
How is MATLAB used at Lynx?
![Page 30: Trend-following in Financial Markets MATLAB EXPO 2014-05 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/30.jpg)
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 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/31.jpg)
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 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/32.jpg)
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 ...](https://reader031.fdocuments.in/reader031/viewer/2022021910/620f551f47a7d420cf4d4db3/html5/thumbnails/33.jpg)
Thank you!