19
Python and MongoDB at AHL 6 th Python for Quant Finance Meetup 9 March 2015 Gary Collier

Python and MongoDB at AHL · 2015. 3. 10. · Python and MongoDB at AHL 6th Python for Quant Finance Meetup 9 March 2015 Gary Collier . Opinions expressed are those of the author

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Python and MongoDB at AHL · 2015. 3. 10. · Python and MongoDB at AHL 6th Python for Quant Finance Meetup 9 March 2015 Gary Collier . Opinions expressed are those of the author

Python and MongoDB at AHL

6th Python for Quant Finance Meetup

9 March 2015

Gary Collier

Page 2: Python and MongoDB at AHL · 2015. 3. 10. · Python and MongoDB at AHL 6th Python for Quant Finance Meetup 9 March 2015 Gary Collier . Opinions expressed are those of the author

Opinions expressed are those of the author and may not be shared by all personnel of Man Group plc (‘Man’). These opinions are subject to change without notice, and are for information purposes only and do not constitute an offer or invitation to make an investment in any financial instrument or in any product to which any member of Man’s group of companies provides investment advisory or any other services. Any forward-looking statements speak only as of the date on which they are made and are subject to risks and uncertainties that may cause actual results to differ materially from those contained in the statements. Unless stated otherwise this information is communicated by Man Investments Limited and AHL Partners LLP which are both authorised and regulated in the UK by the Financial Conduct Authority.

© Man 2015 2

Legal Stuff

Page 3: Python and MongoDB at AHL · 2015. 3. 10. · Python and MongoDB at AHL 6th Python for Quant Finance Meetup 9 March 2015 Gary Collier . Opinions expressed are those of the author

© Man 2015 3

Agenda

Python and MongoDB at AHL 1. AHL 2. Why Python At All? 3. Market Data Platform 4. Questions

10-15 mins

Page 4: Python and MongoDB at AHL · 2015. 3. 10. · Python and MongoDB at AHL 6th Python for Quant Finance Meetup 9 March 2015 Gary Collier . Opinions expressed are those of the author

© Man 2015 4

AHL

Page 5: Python and MongoDB at AHL · 2015. 3. 10. · Python and MongoDB at AHL 6th Python for Quant Finance Meetup 9 March 2015 Gary Collier . Opinions expressed are those of the author

The Platform Divide

© Man 2015 5

Why Python At All?

Page 6: Python and MongoDB at AHL · 2015. 3. 10. · Python and MongoDB at AHL 6th Python for Quant Finance Meetup 9 March 2015 Gary Collier . Opinions expressed are those of the author

© Man 2015 6

Research vs Production

Market  Data  

Pla+orm  

Opera0onal  Tools   Monitoring  and  BI  

Quant  Trading  Strategies  

Trade  Execu0on  System  

Posi0on  Management  System  

Production Trading Environment

Research Environment Market  Data  

Pla+orm  

Visualisa0on  Tools  

IDE  

Por+olio  Builder  

Simula0on  Backtester  

Model  Toolbox  

Page 7: Python and MongoDB at AHL · 2015. 3. 10. · Python and MongoDB at AHL 6th Python for Quant Finance Meetup 9 March 2015 Gary Collier . Opinions expressed are those of the author

© Man 2015 7

The Platform Divide

Page 8: Python and MongoDB at AHL · 2015. 3. 10. · Python and MongoDB at AHL 6th Python for Quant Finance Meetup 9 March 2015 Gary Collier . Opinions expressed are those of the author

Going Pure Python

© Man 2015 8

Get rid of the Divide

Page 9: Python and MongoDB at AHL · 2015. 3. 10. · Python and MongoDB at AHL 6th Python for Quant Finance Meetup 9 March 2015 Gary Collier . Opinions expressed are those of the author

Market Data Storage

© Man 2015 9

Page 10: Python and MongoDB at AHL · 2015. 3. 10. · Python and MongoDB at AHL 6th Python for Quant Finance Meetup 9 March 2015 Gary Collier . Opinions expressed are those of the author

© Man 2015 10

Time-Series Data

Page 11: Python and MongoDB at AHL · 2015. 3. 10. · Python and MongoDB at AHL 6th Python for Quant Finance Meetup 9 March 2015 Gary Collier . Opinions expressed are those of the author

© Man 2015 11

Meta/Reference Data

Page 12: Python and MongoDB at AHL · 2015. 3. 10. · Python and MongoDB at AHL 6th Python for Quant Finance Meetup 9 March 2015 Gary Collier . Opinions expressed are those of the author

MongoDB

© Man 2015 12

Bringing Together Disparate Data Sources

Dat

a A

PI

Page 13: Python and MongoDB at AHL · 2015. 3. 10. · Python and MongoDB at AHL 6th Python for Quant Finance Meetup 9 March 2015 Gary Collier . Opinions expressed are those of the author

© Man 2015 13

Tick Store Architecture

Reuters

RM

DS

Mes

sage

Bus

Bloomberg

Banks

Kafka Queue

Kafka Queue

Kafka Queue

16 shard cluster Master + 1 replica

Linux 12 cores

256 GB RAM 96TB Disk

Infiniband network LZ4 compressed data

MongoDB Cluster

Page 14: Python and MongoDB at AHL · 2015. 3. 10. · Python and MongoDB at AHL 6th Python for Quant Finance Meetup 9 March 2015 Gary Collier . Opinions expressed are those of the author

© Man 2014 14

Performance: 200 Future Markets

Previous Solution MongoDB

Page 15: Python and MongoDB at AHL · 2015. 3. 10. · Python and MongoDB at AHL 6th Python for Quant Finance Meetup 9 March 2015 Gary Collier . Opinions expressed are those of the author

Trading Signal

Derived Data Item

Derived Data Item

Derived Data Item

Derived Data Item

Derived Data Item

Raw Data Items Raw Data

Items Raw Data Items Raw Data

Items Raw Data Item

Multi-user, versioned, interactive graph-based computation

© Man 2014 15

Graph Based Models

Source Data (Managed RDBMS)

Raw Data Items Raw Data

Items Raw Data Items Raw Data

Items Raw Data Item

Derived Data Item

Derived Data Item

Derived Data Item

Derived Data Item

Derived Data Item

Trading Signal

shard 1 shard 2 shard 3 shard 4 shard 1 shard 2 shard 3 shard 4 shard 1 shard 2 shard 3 shard 4

MongoDB Cluster ~1TB Data

~10,000 Stocks ~20 Years

250 Data Items Each Item is 600 MB Single model ~150GB Many Quants and models

Page 16: Python and MongoDB at AHL · 2015. 3. 10. · Python and MongoDB at AHL 6th Python for Quant Finance Meetup 9 March 2015 Gary Collier . Opinions expressed are those of the author

© Man 2014 16

Monitoring and Logs as Data

Page 17: Python and MongoDB at AHL · 2015. 3. 10. · Python and MongoDB at AHL 6th Python for Quant Finance Meetup 9 March 2015 Gary Collier . Opinions expressed are those of the author

© Man 2014 17

Black Box Diagnostics - Visualisation

Page 18: Python and MongoDB at AHL · 2015. 3. 10. · Python and MongoDB at AHL 6th Python for Quant Finance Meetup 9 March 2015 Gary Collier . Opinions expressed are those of the author

© Man 2014 18

Kibana

Page 19: Python and MongoDB at AHL · 2015. 3. 10. · Python and MongoDB at AHL 6th Python for Quant Finance Meetup 9 March 2015 Gary Collier . Opinions expressed are those of the author

© Man 2015 19

Questions

Gary Collier [email protected]