From HFT to Laplace Demon

When timed data technology

curves the market

@erichoresnyi

@abifet

HFT in the hey days

5ms=20m$

Source: Tabb Group

High Frequency Trading

$100trn

CapGroup

Vanguard

StateStreet

BoNY

JPM

Pimco

Fidelity

GS

Prudential

AUM>$1trn, source: Towers Watson

Blackrock*

*Blackrock is actually headquartered in NY, main AUM coming from ETF/ passive originally BGI in SF

Approx 3xGDP in USA ie 155k$/hab

HFT context

Liquidity Flow

Buy Side 2

Buy Side 1

NASDAQ

NYSE

NSX

Sell Side 2

Sell Side 1

70% Algo

PCX

HFT context

Order Flow

NY

NJ

CT

IL

Sell Side 2

Sell Side 1

Market Maker

CA

HFT context

Reg.ATS'98-Reg.NMS'05

PCX

INET

BRUT

NASDAQ

CME

CBOT

ICE

BATS

NYSE

ARCA

CBOE

NYMEX

IEX

Cambrian Explosion

HFT context

Infra view

NJ

NJ

NY

IL

CO

POP

Fiber

20ms

2ms

2ms

4ms

HFT context

HFT: Proximity

NY

NJ

CT

IL

16

2

1

1

1

Host in Network Nodes, then Exchanges

HFT

+

Serialization

Latency

=

 

+

Processing

Propagation

HFT: Ultra

NY

NJ

CT

IL

HFT

Dark Fiber

1

1

15

Buy-Side view of HFT

It's not a ghost...

HFT: Straight Fiber

1,000 miles > 825 miles

14.5 ms > 11.5 ms

HFT: Microwaves

11.5 > 8.5ms
N:1.33 > 1.0003
v = c/n

HFT: FPGA

Nanosecs

Choose your lane

HFT <> Algo Trading

"Once you get into milliseconds it's almost not HFT any more"

Spacetime is relative

Market Events: [ct,x,y,z]

Speed curves spacetime

HFT built a wormhole to win on [ct',x,y,z] events 

Mass curves spacetime

AI builds a blackhole by massively processing [ct,x,y,z] events

G_{\mu \nu }+\Lambda g_{\mu \nu }={8\pi G \over c^{4}}T_{\mu \nu }

{

Laplace Demon

The endgame of Determinism

  [ct,x,y,z] Rn    [ct',x',y',z']

The Endgame 1/3

Event Machine View

The Endgame 2/3

Loss aka Cost Function = J(θ) : distance points to line

Graph View : Regression

The Endgame 3/3

{\begin{bmatrix}x_{0}, x_{1}, ..., x_{n}\end{bmatrix}}

Features

Labels

 

$AAPL

$GOOG

.
 

$FB

{\begin{bmatrix}y_{1}\\y_{2}\\.\\y_{n}\end{bmatrix}}

Matrix view

{\begin{bmatrix} w_{1,1} w_{1,2} ... w_{1,n}\\ w_{2,1} w_{2,2} ... w_{2,n}\\ w_{...,1} w_{...,2} ... w_{...,n}\\ w_{n,1} w_{n,2} ... w_{n,n} \end{bmatrix}}

Matrices of Weights

AI not news to trading

+35% yoy for 20 years : $2,500 > $1,000,000

PhD Mathematics, Berkeley - String Theory Chern-Simons Form

AI age:Gradient Descent

Follow the steepest slope, 100m+ features

α : Learning Rate, ∇ J : Gradient

AI age:Back Propagation

Adapt weight to control error from previous layer's input, 150+ layers

Source: Neural Networks simulation by Matt Mazur at Emergent Mind 

AI age: GPU

From Final Fantasy to Autonomous Car

"The implementation of streaming algorithms, typied by highly parallel computations with little reuse of input data, has been widely explored on GPUs."

Bullish Fitness Drill

1-Train

2-Validate

3-Test

Overfitting?

Bearish Fitness Drill

1-Train

2-Validate

3-Test

Overfitting?

Standard Approach

Batch-based, finite training sets, static models

Dataset

Model

Data Stream Approach

Infinite training sets, dynamic models

D

D

D

D

D

D

M

M

M

M

M

M

Approximation Algo

What is the largest number that we can store in 8 bits?

Approximation Algo

What is the largest number that we can store in 8 bits?

Approximation Algorithm

Massive

Online

Analysis

Stream Setting

Process an example at a time

Inspect it only once (at most)

 

Use a limited amount of  memory

 

Work in a limited amount of  time

 

Be ready to predict at any point

Prequential Evaluation 

Sequence of examples > Error of a model

Command Line

java -cp .:moa.jar:weka.jar -javaagent:sizeofag.jar moa.DoTask 
EvaluatePrequential 

-l DecisionStump //training DecisionStump classifier ...

-s generators.WaveformGenerator //...on WaveformGenerator data

-n 100000 //using the first 100 thousand examples for testing

-i 100000000 //training on a total of 100 million examples

-f 1000000 //testing every one million examples

> dsresult.csv

Resourceful

Classification

Regression

Concept Drift

Sentiment Analysis

Stock Price

Alerting

Simple

learner.getVotesForInstance(instance)
learner.trainOnInstance(instance)

Scalable

http://samoa-project.net

An experiment

Public Stock Dataset

MOA Regression

Stock Price

Error

An Experiment

The New HF Frontier: AI

{API}

Sentiment     Analysis

Alerts

Regression/Perceptron

Fast vs Smart

Data Stream a compromise

ct

x,y,z

HFT

AI

Data Stream

Thanks!

Apache & Wikipedia Foundation : please donate!

MOA, Kaggle & Giphy : please contribute!
 

Books & Lectures

Data Stream Mining, MOA team

Yann LeCun Deep Learning Class, NYU

Matt Mazure, Emergent Mind & Andrew Ng, Coursera on AI

My Life as a Quant:Reflections on Physics&Finance, E.Derman

The Value of a Millisecond: Finding the Optimal Speed of a Trading Infra., TabbGroup

Flashboys, M.Lewis

Movies & Games

The Big Short, Back to the Future, Interstellar, The Black Hole,

Harry Potter, Rocky, Into the Mind, Star Wars, Matrix; Final Fantasy

The move to AI: From HFT to Laplace Demon @ Qcon London'17

By Streamdata.io

The move to AI: From HFT to Laplace Demon @ Qcon London'17

The race for low latency data continues. 10 years ago, Flashboys were helping HFT make money with low-latency infrastructures. Today, hedge funds build AI brains pumping hundreds of sources of data in real-time, seeking ubiquity to build Laplace Demons.

  • 749