0 views

Original Title: 1quantitativetradingasamathematicalsciencebydr-161112031504

Uploaded by Kofi Appiah-Danquah

- SI Prevention and Optimization
- Huawei Parameter Optimization
- NPV With Multiple Compounding Periods and Uniform Cash Flows
- elenco_abil
- Chachuat2009
- Lecture 0
- 6f785e03eda385cf5ff2e49081e6eeaafcce
- Intze Type Water Tank
- 2013 Yousefikia Mamdoohi Moridpour Noruzoliaee Mahpour
- UpdateSept07
- 11ME7IEOPR (3)
- Artificial_Bee_Colony_Algorithm_for_Economic_Load_.pdf
- Mark Joshi - Reading List
- How to Measure Roll Quality
- math_approach_order_book_modelling
- AN ON -LINE RELAY COORDINATION ALGORITHM FOR ADAPTIVE PROTECTION USING LINEAR PROGRAMMING TECHNIQUE_1996.pdf
- Fem Approach to Simulating Al Quench
- Sing Levar Opt
- Optimal Control a Review of Theory and Practice
- Chapter 9

You are on page 1of 54

Haksun Li

haksun.li@numericalmethod.com

www.numericalmethod.com

Abstract

Quantitative trading is distinguishable from other trading methodologies like

technical analysis and analysts opinions because it uniquely provides justifications

to trading strategies using mathematical reasoning. Put differently, quantitative

trading is a science that trading strategies are proven statistically profitable or even

optimal under certain assumptions. There are properties about strategies that we

can deduce before betting the first $1, such as P&L distribution and risks. There are

exact explanations to the success and failure of strategies, such as choice of

parameters. There are ways to iteratively improve strategies based on experiences of

live trading, such as making more realistic assumptions. These are all made possible

only in quantitative trading because we have assumptions, models and rigorous

mathematical analysis.

Quantitative trading has proved itself to be a significant driver of mathematical

innovations, especially in the areas of stochastic analysis and PDE-theory. For

instances, we can compute the optimal timings to follow the market by solving a

pair of coupled HamiltonJacobiBellman equations; we can construct sparse mean

reverting baskets by solving semi-definite optimization problems with cardinality

constraints and can optimally trade these baskets by solving stochastic control

problems; we can identify statistical arbitrage opportunities by analyzing the

volatility process of a stochastic asset at different frequencies; we can compute the

optimal placements of market and limit orders by solving combined singular and

impulse control problems which leads to novel and difficult to solve quasi-

variational inequalities.

2

Speaker Profile

Dr. Haksun Li

CEO, NM LTD.

(Ex-)Adjunct Professors, Industry Fellow, Advisor,

Consultant with the National University of Singapore,

Nanyang Technological University, Fudan University,

the Hong Kong University of Science and Technology.

Quantitative Trader/Analyst, BNPP, UBS

Ph.D., Computer Science, University of Michigan Ann

Arbor

M.S., Financial Mathematics, University of Chicago

B.S., Mathematics, University of Chicago

3

What is Quantitative Trading?

4

Quantitative Trading?

Quantitative trading is the buying and selling of assets

following the instructions computed from a set of

proven mathematical models.

The differentiation from other trading methodologies

or the emphasis is on how a strategy is proven and

not on what strategy is created.

It applies (rigorous) mathematical reasoning in all

steps during trading strategy construction from the

start to the end.

5

Moving Average Crossover as a TA

A popular TA signal: Moving Average Crossover.

A crossover occurs when a faster moving average (i.e. a

shorter period moving average) crosses above/below a

slower moving average (i.e. a longer period moving

average); then you buy/sell.

In most TA book, it is never proven only illustrated

with an example of applying the strategy to a stock for

a period of time to show profits.

6

Technical Analysis is Not Quantitative Trading

TA books merely describes the mechanics of strategies

but never prove them.

Appealing to common sense is not a mathematical

proof.

Conditional probabilities of outcomes are seldom

computed. (Lo, Mamaysky, & Wang, 2000)

Application of TA is more of an art (is it?) than a

science.

How do you choose the parameters?

For any TA rule, you almost surely can find an asset

and a period that the rule works, given the large

number of assets and many periods to choose from.

7

Fake Quantitative Models

Data snooping

Misuse of mathematics

Assumptions cannot be quantified

No model validation against the current regime

Ad-hoc take profit and stop-loss

why 2?

How do you know when a model is invalidated?

Cannot explain winning and losing trades

Cannot be analyzed (systematically)

8

The Quantitative Trading Research

Process

9

NM Quantitative Trading Research Process

1. Translate a vague trading intuition (hypothesis) into

a concrete mathematical model.

2. Translate the mathematical symbols and equations

into a computer program.

3. Strategy evaluation.

4. Live execution for making money.

10

Step 1 - Modeling

Where does a trading idea come from?

Ex-colleagues

Hearsays

Newspapers, books

TV, e.g., Moving Average Crossover (MA)

A quantitative trading strategy is a math function, f,

that at any given time, t, takes as inputs any

information that the strategy cares and that is

available, Ft, and gives as output the position to take,

f(t,Ft).

11

Step 2 - Coding

The computer code enables analysis of the strategy.

Most study of a strategy cannot be done analytically.

We must resort to simulation.

The same piece of code used for research and

investigation should go straight into the production

for live trading.

Eliminate the possibility of research-to-IT translation

errors.

12

Step 3 Evaluation/Justification

Compute the properties of a trading strategy.

the P&L distribution

the holding time distribution

the stop-loss

the maximal drawdown

http://redmine.numericalmethod.com/projects/publi

c/repository/svn-

algoquant/show/core/src/main/java/com/numericalm

ethod/algoquant/execution/performance

13

Step 4 - Trading

Put in capitals incrementally.

Install safety measures.

Monitor the performance.

Regime change detection.

14

Mathematical Analysis of Moving

Average Crossover

15

Moving Average Crossover as a Quantitative

Trading Strategy

There are many mathematical justifications to Moving

Average Crossover.

weighted Sum of lags of a time series

Kuo, 2002

Whether a strategy is quantitative or not depends not

on the strategy itself but

entirely on the process to construct it;

or, whether there is a scientific justification to prove it.

16

Step 1 - Modeling

Two moving averages: slower () and faster ().

Monitor the crossovers.

1 1 1 1

= ,>

=0 =0

Long when 0.

Short when < 0.

How to Choose and ?

It is an art, not a science (so far).

They should be related to the length of market cycles.

Different assets have different and .

Popular choices:

(250, 5)

(250 , 20)

(20 , 5)

(20 , 1)

(250 , 1)

Two Simplifications

Reduce the two dimensional problem to a one

dimensional problem.

Choose = 1. We know that m should be small.

Replace arithmetic averages with geometric averages.

This is so that we can work with log returns rather than

prices.

19

GMA(n , 1)

1

0 iff 1

=0

+1

2

=1 (by taking log)

1

1

=0

+1

< 2

=1 (by taking log)

1

What is ?

=2

=

Acar Framework

Acar (1993): to investigate the probability distribution

of realized returns from a trading rule, we need

the explicit specification of the trading rule

the underlying stochastic process for asset returns

the particular return concept involved

Knight-Satchell-Tran Intuition

Stock returns staying going up (down) depends on

the realizations of positive (negative) shocks

the persistence of these shocks

Shocks are modeled by gamma processes.

Asymmetry

Fat tails

Persistence is modeled by a Markov switching process.

Knight-Satchell-Tran

1-q

Zt = 0

Zt = 1

DOWN

UP TREND

q TREND p

1 1 1 1

2 2 2 1 = 1

= 2 1

2

1-p

Knight-Satchell-Tran Process

= + 1

: long term mean of returns, e.g., 0

, : positive and negative shocks, non-negative, i.i.d

1 1 1 1

= 1

1

2 2 2 1

= 2

2

Step 3 Evaluation/Justification

Assume the long term mean is 0, = 0.

When = 2,

0 0 = 1

< 0 < 0 = 0

GMA(2, 1) Nave MA Trading Rule

Buy when the asset return in the present period is

positive.

Sell when the asset return in the present period is

negative.

Nave MA Conditions

The expected value of the positive shocks to asset

return >> the expected value of negative shocks.

The positive shocks persistency >> that of negative

shocks.

Period Returns

= =1 1 0

hold

< 0

0 1

Sell at this time point

Holding Time Distribution

=

= < 0, 1 0, , 1 0, 0 0

= = 0, 1 = 1, , 1 = 1, 0 = 1

= = 0, 1 = 1, , 1 = 1|0 = 1 0 = 1

1 1 , T 1

=

1 , T=0

1

=

2

Conditional Returns Distribution (1)

=1 1 0

|= = E | =

=1 1 0

=E | < 0, 1 0, , 0 0

=1

=E | = 0, 1 = 1, , 1 = 1

1 ++1

=E

1 , T 1

=

, T =0

Unconditional Returns Distribution (2)

=

=1 1 0

=0 E | = =

=

1

=1 1

1 + 1

= 1 + 1

1

Expected Returns

E = 0

1

= 1

1

When is the expected return positive?

1

, shock impact

, shock impact

1 , if , persistence

GMA(,1) Rule

1

1

=0

1 1

ln ln

=0

ln 1

GMA(,1) Expected Returns

=

1 + +

1 1 +

E = 1 1 +

MA Using the Whole History

An investor will always expect to lose money using

GMA(,1)!

An investor loses the least amount of money when the

return process is a random walk.

Optimal MA Parameters

So, what are the optimal and ?

Step 2: AR(1)

Step 2 : ARMA(1, 1)

no systematic

winner

optimal

order

Step 2 : ARIMA(0, d, 0)

Live Results of Quantitative Trading

Strategies

41

Unique Guiding Principle

What Others Do: What We Do:

Start with a trading strategy. Start with simple assumptions

about the market.

Find the data that the Compute the optimal trading

strategy works. strategy given the

Result: assumptions.

Paper P&L looks good. Result:

Can mathematically prove

Live P&L depends on luck. that no other strategy will

Trading strategies are work better in the same

results of a non-scientific, market conditions.

a pure data snooping Trading strategies are results

of a scientific process.

process.

42

Optimal Trend Following (TREND)

We make assumptions that the market is a two (or 160.00%

three) state model. The market state is either up,

down, (or sideway). 140.00%

negative, or zero drift. 100.00%

We use math to compute what the best thing to do is 80.00%

in each of the states.

60.00%

We estimate the conditional probability, , of that the

market is going up given all the available information. 40.00%

When is big enough, i.e., most certainly that the 20.00%

market is going up, we buy.

0.00%

Result:

trading period 2015/1/2 - 2016/5/2

Hang Seng china enterprises

assets traded index futures

annualized

return 107.00%

max

drawdown 6.61%

Sharpe ratio 4.79

Optimal Trend Following (Math)

Two state Markov model for a stocks prices: BULL and Value function:

BEAR. J0 , , , 0 =

1 +

= + , < E 1

=1 log + < log 1+ + +1

The trading period is between time , .

J1 , , , 1 =

= 1,2 are the two Markov states that indicates

1

the BULL and BEAR markets. log + 2 1 + log 1 +

E 1

1 > 0

=2 log + < log 1+ + +1

the value functions are maximized.

1 1

= , the generator matrix for the Markov , = sup , , ,

2 2

1

E0, = 1 , = sup log

1

+ log 1 + 0 1 , 1

1

1 <

E 1 =1 +1

1+

Hamilton-Jacobi-Bellman Equations

We are long between and and the return is

determined by the price change discounted by the min 0 , 0 1 + log 1 + = 0

min 1 , 1 0 log 1 = 0

commissions.

0 , = 0

We are flat between and +1 and the money with terminal conditions:

1 , = log 1

grows at the risk free rate. 1 1 2 1 2

= + + 1 + 2 + 2

2

Based on: M Dai, Q Zhang, QJ Zhu, "Trend following trading under a regime switching

model," SIAM Journal on Financial Mathematics, 2010.

Optimal Mean Reversion (MR)

Basket construction problem:

Select the right financial instruments.

Obtain the optimal weights for the

selected financial instruments.

Basket trading problem:

Given the portfolio can be modelled

as a mean reverting OU process,

dynamic spread trading is a stochastic

optimal control problem.

Given a fixed amount of capital,

dynamically allocate capital over a

risky mean reverting portfolio and a

risk-free asset over a finite time

horizon to maximize a general

constant relative risk aversion (CRRA)

utility function of the terminal

wealth .

Allocate capital amongst several

mean reverting portfolios.

Based on: Mudchanatongsuk, S., Primbs, J.A., Wong, " Optimal Pairs Trading: A

Stochastic Control Approach," Dept. of Manage. Sci. & Eng., Stanford Univ., CA.

45

Optimal Mean Reversion (Math)

Assume a risk free asset , which satisfies

=

Assume two assets, and .

Assume follows a geometric Brownian

motion.

= +

is the spread between the two assets.

covariance selection = log log

= + +

1

= + 2 + + +

2

max , s.t.,

0 = 0 , x 0 = 0

= +

= = +

= + 2 +

1 2

46

Intraday Volatility Trading (VOL)

In mid or high frequency trading, or 140.00%

80.00%

20.00%

0.00%

-20.00%

loss region

Live Result:

trading period 2014/2/27 - 2015/2/27

profit region

Hang Seng china enterprises

assets traded index futures

annualized

return 122.32%

max

drawdown 10.24%

Sharpe ratio 18.45

47

Intraday Volatility Trading (Math)

For a continuous price process , we Define a trading strategy such that the

define H-variation position of X is:

, = sup =1 1 , =

,

=1 sign 1 1 1,

It can be shown that for any H, there

exists a sequence , =0,1,, such The trend following P&L is:

that =0,1,, are Markovian and

, = 0 ,

are defined by on intervals 1 , .

And they satisfy the equality: = , 2 , +

, =

=1 1 The expected income per trade is:

, is the number of KAGI-

, = 0 ,

inversion in the T-interval.

,

H-volatility: , =

,

,

, = lim E , = 2

,

For an no-arbitrage Wiener process, we

have

lim , = = 2

analysis," Theory of Probability & Its Applications, SIAM, 2005.

48

Optimal Market Making (MM)

We optimally place limit and market 40.00%

orders depending on the current 35.00%

inventory and spread. 30.00%

25.00%

20.00%

the best market making strategy:

15.00%

10.00%

5.00%

0.00%

Live Result:

trading period 2015/7/16 - 2016/3/1

rebar + iron ore commodity

assets traded futures

annualized

return 65%

max

drawdown 0.90%

Sharpe ratio 16.71

49

Optimal Market Making (Math)

State variable: Quasi-Variational Inequality

, , , min sup , + , = 0

Objective: , , , , = , , ,

max E 0

=1 , , , , , ,

= 0, e.g., dont hold position overnight sup , , , + , , , ,

min =0

: utility function

sup , + , , , , , ,

+,

: terminal wealth , , , sup , , , + ,

: penalty for holding inventory , , , = , ,

Liquidation function (how much we get by selling Assumptions:

everything): = ; we care about only how much money made.

, , , = , , = + is a martingale; we know nothing about where the market will move.

2

Solution:

Equivalent problem (get rid of = 0):

, , , = + + ,

max E , , , 0 , is the solution to the system of integro-differential equations

(IDE):

Value function:

=1 , ,

, , = sup E , sup , + , +

1 =+

,, 2

min sup , , +

1 = =0

= , , 2

+ ,

This is a mixed regular/impulse control problem in a , sup , +

regime switching jump-diffusion model. 2

, =

2

Based on: F Guilbaud, H Pham, "Optimal high-frequency trading with limit and market

orders," Quantitative Finance, 2013.

50

Conclusions

51

FinMath Infrastructure Support

All these mathematics and simulations are possible only with a

finmath technology that serves as the modeling infrastructure.

Applications

Financial

Mathematics

Advanced Cointegration Time Series Analysis

SQP, SDP, SOCP, IP,

Digital Signal Processing

GA)

Mathematics

Unconstrained

optimization

Statistics Differential

Equations

Parallelization

Mathematics

= local minimum

global minimum

52

The Essential Skills

Financial intuitions, market understanding, creativity.

Mathematics.

Computer programming.

53

An Emerging Field

It is a financial industry where mathematics and

computer science meet.

It is an arms race to build

more reliable and faster execution platforms (computer

science);

more comprehensive and accurate prediction models

(mathematics).

54

- SI Prevention and OptimizationUploaded byPhaniKumarDhulipaala
- Huawei Parameter OptimizationUploaded byShafiyyah
- NPV With Multiple Compounding Periods and Uniform Cash FlowsUploaded byShannon Roberts
- elenco_abilUploaded byaskafjwpij98u
- Chachuat2009Uploaded byCarloyos Hoyos
- Lecture 0Uploaded by_MerKeZ_
- 6f785e03eda385cf5ff2e49081e6eeaafcceUploaded byGastónBütikofer
- Intze Type Water TankUploaded byNitya Patel
- 2013 Yousefikia Mamdoohi Moridpour Noruzoliaee MahpourUploaded byKeith Anshilo Diaz
- UpdateSept07Uploaded byapi-27370939
- 11ME7IEOPR (3)Uploaded byharish
- Artificial_Bee_Colony_Algorithm_for_Economic_Load_.pdfUploaded byAnmol SINGH PARIHAR
- Mark Joshi - Reading ListUploaded byMeng Ke
- How to Measure Roll QualityUploaded byDeming
- math_approach_order_book_modellingUploaded byBella Dubrov
- AN ON -LINE RELAY COORDINATION ALGORITHM FOR ADAPTIVE PROTECTION USING LINEAR PROGRAMMING TECHNIQUE_1996.pdfUploaded bygavinilaa
- Fem Approach to Simulating Al QuenchUploaded byfdcarazo
- Sing Levar OptUploaded byDiego Isla
- Optimal Control a Review of Theory and PracticeUploaded bymykingboody2156
- Chapter 9Uploaded byHassan Funsho Akande
- Data Leakage DetectionUploaded byanon_972148031
- sree1Uploaded byArun Kumar
- Sine Calafiore 4Uploaded bySathish Krishna
- Optimal Design of Pre-control PlansUploaded byvicentgin
- 06029809sdUploaded byDuško Tovilović
- Lee WebUploaded byKumar Siddhartha
- Introduction to Stochastic Processes with Applications in the BiosciencesUploaded bymushr00mcloud
- VMOD MGOTransport TutorialUploaded byAnonymous ujaUmXi
- Content ServerUploaded byWawan Fadel
- Thermal processing and quality= Principles and overviewUploaded byalbisperez

- Vector Calc NotesUploaded byKofi Appiah-Danquah
- pydata2013-131109164613-phpapp02Uploaded byKofi Appiah-Danquah
- tmp_524-btc-guide339320327Uploaded byHamid Mahmood
- 1.2 Data Basics.pdfUploaded byKofi Appiah-Danquah
- User Manual,Virtual BoxUploaded byRafael
- Classical Asset Allocation - Combining Markowitz and MomentumUploaded byKofi Appiah-Danquah
- Career Outlook - Financial SpecialistsUploaded byKofi Appiah-Danquah
- Regulatory Compliance and Banks Key Challenges and Effective SolutionsUploaded byKofi Appiah-Danquah
- ConnorsRSI Pullbacks GuidebookUploaded byBill Hunter
- rmarkdown-reference.pdfUploaded byKofi Appiah-Danquah
- a-gentle-introduction-to-blockchain-technology-web.pdfUploaded byFiroz
- Computational FinanceUploaded byJms008
- High dimensional statistical inference and random matricesUploaded byKofi Appiah-Danquah
- Intellectual Property...a Powerful Tool for Economic GrowthUploaded byKofi Appiah-Danquah
- 1.4 Sampling and Sources of BiasUploaded byKofi Appiah-Danquah
- stock priceUploaded bySingh Ak
- Windows Installation Guide v 1Uploaded byKofi Appiah-Danquah
- Strategies for Effective Wall Post.pdfUploaded byKofi Appiah-Danquah
- L18.cumulantsUploaded byKofi Appiah-Danquah
- Algorithmic and High-frequency Trading - An OverviewUploaded byKofi Appiah-Danquah
- Moment Identities for Poisson-Skorohod IntegralsUploaded byKofi Appiah-Danquah
- Computational Finance on GPUUploaded byKofi Appiah-Danquah
- Karel the Robot Learn JavaUploaded byBank
- Quant TradingUploaded byChristopher M. Patten
- Covariance Identities and Mixing of Random Transformation of the Wiener SpaceUploaded byKofi Appiah-Danquah
- Self EmploymentUploaded byKofi Appiah-Danquah
- Statistics Machine Learning Python DraftUploaded byKofi Appiah-Danquah
- The Complete Guide to Facebook AnalyticsUploaded byBob Hazlett
- MATLAB Mathematical Analysis [2014]Uploaded byKofi Appiah-Danquah

- Ohmic-testing Ag en v01Uploaded byViniOr Salguero
- Domestic Refrigerator Parts and Their WorkingUploaded byPrabhat Sharma
- Boric AciddUploaded bydinesh111180
- Gene.pdfUploaded byZaidi
- Root System DouglasUploaded bylxbrat
- SolarisUploaded byonline_khoj
- itron sentinel1Uploaded bygdockery
- C3_Ch17_FS_eUploaded byLaplaceNerd
- RevisedStokesLawSedimentationandSettlingDesignUploaded byUghamadu Chike
- Bailey Time_perspectives_palimpsests.pdfUploaded byb6121432
- design_seismic_LNG_tanksUploaded byvttrlc
- Computer Aided Design for Underground Cable System 00818708Uploaded byGilberto Mejía
- How to Investigate and Optimize LTE Throughput in 5 StepsUploaded byAbdul Rahim Shaikh
- 2811 Extending Quality Notification Functionality Through Subscreens and the Action BoxUploaded byOlya Solar
- RP-040046Uploaded byRuchira Chinthaka
- Imp NotesUploaded byShashi Shirke
- A&B 1Uploaded byqu0rra
- Atomic Structure 1 DecryptedUploaded byAtul Verma
- Experiments in Model Granular Media- A Study of Gravity Flows Rajchenbach, Clement and DuranUploaded byAllan Erlikhman
- Sylvania Lighting Equipment Ordering Guide & Price Schedule Indoor 1-70Uploaded byAlan Masters
- Developing your musicianship - L06 Study GuideUploaded bytelmex6078
- Block Sorting Text Compression.psUploaded byΟλυμπίδης Ιωάννης
- Tutorial Map 6Uploaded byMihaela Sanpetrean
- Mathematics SyllabusUploaded bysayhigaurav07
- chp-26Uploaded bySanjay Kumar
- InvensysCAD - Creo Behavioral Modeling ExtensionUploaded byanilpagar
- 10th Ncert Exempler FullUploaded byAnish Talwar
- lsmw tutorialsUploaded bysagar_sea
- Sponge IronUploaded byudayamavuri
- Stress AnalysisUploaded byvikrantgulhane