mathematical models in finance: trading strategies...paul johnson mathematical models in finance:...

35
MATHEMATICAL MODELS IN F INANCE : T RADING S TRATEGIES Paul Johnson School of Mathematics July 2019 Paul Johnson Mathematical Models in Finance: Trading Strategies

Upload: others

Post on 07-Mar-2021

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

MATHEMATICAL MODELS IN FINANCE:TRADING STRATEGIES

Paul Johnson

School of Mathematics

July 2019

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 2: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

TRADING STRATEGIES

TODAY’S LECTURE

Background

A Mathematical Model for Stock Price

Simulating and Testing Trading Strategies

Can it Work on Real Data?

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 3: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

BACKGROUND

I’m Paul Johnson, a Senior Lecturer inMathematical Finance

Worked in the department for over 10yearsResearch in numerical solutions tonon-linear PDEs arising in financeApplications in Finance, Mining,Revenue Management systems,Renewable EnergyTeach Mathematical Finance in theundergraduate program andComputational Finance at postgraduatelevel.

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 4: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

BACKGROUND

I’m Paul Johnson, a Senior Lecturer inMathematical FinanceWorked in the department for over 10years

Research in numerical solutions tonon-linear PDEs arising in financeApplications in Finance, Mining,Revenue Management systems,Renewable EnergyTeach Mathematical Finance in theundergraduate program andComputational Finance at postgraduatelevel.

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 5: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

BACKGROUND

I’m Paul Johnson, a Senior Lecturer inMathematical FinanceWorked in the department for over 10yearsResearch in numerical solutions tonon-linear PDEs arising in finance

Applications in Finance, Mining,Revenue Management systems,Renewable EnergyTeach Mathematical Finance in theundergraduate program andComputational Finance at postgraduatelevel.

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 6: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

BACKGROUND

I’m Paul Johnson, a Senior Lecturer inMathematical FinanceWorked in the department for over 10yearsResearch in numerical solutions tonon-linear PDEs arising in financeApplications in Finance, Mining,Revenue Management systems,Renewable Energy

Teach Mathematical Finance in theundergraduate program andComputational Finance at postgraduatelevel.

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 7: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

BACKGROUND

I’m Paul Johnson, a Senior Lecturer inMathematical FinanceWorked in the department for over 10yearsResearch in numerical solutions tonon-linear PDEs arising in financeApplications in Finance, Mining,Revenue Management systems,Renewable EnergyTeach Mathematical Finance in theundergraduate program andComputational Finance at postgraduatelevel.

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 8: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

TRADING STRATEGIES

Algorithmic Trading and technological solutions are rapidlyadvancing in the financial sectorAn Algorithmic Trade executes a series of trades (to buy orsell a stock) according to a predefined strategy

So who comes up with the strategy?We need a model ... a strategy ... and a way to test it ...

We need Mathematics!!!

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 9: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

TRADING STRATEGIES

Algorithmic Trading and technological solutions are rapidlyadvancing in the financial sectorAn Algorithmic Trade executes a series of trades (to buy orsell a stock) according to a predefined strategy

So who comes up with the strategy?We need a model ... a strategy ... and a way to test it ...

We need Mathematics!!!

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 10: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

TRADING STRATEGIES

Algorithmic Trading and technological solutions are rapidlyadvancing in the financial sectorAn Algorithmic Trade executes a series of trades (to buy orsell a stock) according to a predefined strategy

So who comes up with the strategy?We need a model ... a strategy ... and a way to test it ...

We need Mathematics!!!

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 11: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

TRADING STRATEGIES

Algorithmic Trading and technological solutions are rapidlyadvancing in the financial sectorAn Algorithmic Trade executes a series of trades (to buy orsell a stock) according to a predefined strategy

So who comes up with the strategy?We need a model ... a strategy ... and a way to test it ...

We need Mathematics!!!

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 12: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

TRADING STRATEGIES

Algorithmic Trading and technological solutions are rapidlyadvancing in the financial sectorAn Algorithmic Trade executes a series of trades (to buy orsell a stock) according to a predefined strategy

So who comes up with the strategy?We need a model ... a strategy ... and a way to test it ...

We need Mathematics!!!

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 13: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

TRADING STRATEGIES

Algorithmic Trading and technological solutions are rapidlyadvancing in the financial sectorAn Algorithmic Trade executes a series of trades (to buy orsell a stock) according to a predefined strategy

So who comes up with the strategy?We need a model ... a strategy ... and a way to test it ...

We need Mathematics!!!

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 14: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

TRADING STRATEGIES

Algorithmic Trading and technological solutions are rapidlyadvancing in the financial sectorAn Algorithmic Trade executes a series of trades (to buy orsell a stock) according to a predefined strategy

So who comes up with the strategy?

We need a model ... a strategy ... and a way to test it ...

We need Mathematics!!!

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 15: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

TRADING STRATEGIES

Algorithmic Trading and technological solutions are rapidlyadvancing in the financial sectorAn Algorithmic Trade executes a series of trades (to buy orsell a stock) according to a predefined strategy

So who comes up with the strategy?We need a model ... a strategy ... and a way to test it ...

We need Mathematics!!!

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 16: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

TRADING STRATEGIES

Algorithmic Trading and technological solutions are rapidlyadvancing in the financial sectorAn Algorithmic Trade executes a series of trades (to buy orsell a stock) according to a predefined strategy

So who comes up with the strategy?We need a model ... a strategy ... and a way to test it ...

We need Mathematics!!!

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 17: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

MODELLING THE REAL WORLD

1 The Mathematical ModelHow does stock price change?How do we capture our uncertainty about predicting thefuture?

2 The Simulation EnvironmentHow do we execute a trade in mathematics?How do we keep track of our money/stock?

3 The Real WorldHow realistic is our model?How likely is it to cause huge losses?

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 18: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

MODELLING THE REAL WORLD

1 The Mathematical ModelHow does stock price change?How do we capture our uncertainty about predicting thefuture?

2 The Simulation EnvironmentHow do we execute a trade in mathematics?How do we keep track of our money/stock?

3 The Real WorldHow realistic is our model?How likely is it to cause huge losses?

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 19: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

MODELLING THE REAL WORLD

1 The Mathematical ModelHow does stock price change?How do we capture our uncertainty about predicting thefuture?

2 The Simulation EnvironmentHow do we execute a trade in mathematics?How do we keep track of our money/stock?

3 The Real WorldHow realistic is our model?How likely is it to cause huge losses?

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 20: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

A MATHEMATICAL MODEL FOR STOCK PRICES

A Brownian motion model for stocks is one of the most simpleand popular models in finance. Consider St is the price of thestock at time t , it looks like this:

dS = µStdt + σStdW

which means:

change in stock price = deterministic trend + random component

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 21: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

SIMULATED TRADING ACCOUNT

The total value Wt of our trading account is:-

Wt = ∆tSt + Bt

where:

∆t ≥ 0 is the number of stocks we own at time tSt ≥ 0 is the price to buy/sell stock at time tBt ≥ 0 is the amount of money we have at time t

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 22: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

SIMULATED TRADING ACCOUNT

The total value Wt of our trading account is:-

Wt = ∆tSt + Bt

where:∆t ≥ 0 is the number of stocks we own at time t

St ≥ 0 is the price to buy/sell stock at time tBt ≥ 0 is the amount of money we have at time t

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 23: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

SIMULATED TRADING ACCOUNT

The total value Wt of our trading account is:-

Wt = ∆tSt + Bt

where:∆t ≥ 0 is the number of stocks we own at time tSt ≥ 0 is the price to buy/sell stock at time t

Bt ≥ 0 is the amount of money we have at time t

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 24: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

SIMULATED TRADING ACCOUNT

The total value Wt of our trading account is:-

Wt = ∆tSt + Bt

where:∆t ≥ 0 is the number of stocks we own at time tSt ≥ 0 is the price to buy/sell stock at time tBt ≥ 0 is the amount of money we have at time t

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 25: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

EXECUTING A TRADE

To buy a stock, increase ∆:-

∆t+1 = ∆t + 1

and we pay S out of the bank account

Bt+1 = Bt − St+1

To sell a stock, decrease ∆:-

∆t+1 = ∆t − 1

and we deposit S into the bank account

Bt+1 = Bt + St+1

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 26: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

EXECUTING A TRADE

To buy a stock, increase ∆:-

∆t+1 = ∆t + 1

and we pay S out of the bank account

Bt+1 = Bt − St+1

To sell a stock, decrease ∆:-

∆t+1 = ∆t − 1

and we deposit S into the bank account

Bt+1 = Bt + St+1

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 27: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

A TRADING STRATEGY

A trading strategy is a function T that instructs a change in theamount of stock we hold. So

∆t+1 = ∆t + T (S,W ,∆,B)

We are interested in defining thefunction Tand examing the expected profit of thestrategy

expected profit = E [WT ] − W0

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 28: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

A TRADING STRATEGY

A trading strategy is a function T that instructs a change in theamount of stock we hold. So

∆t+1 = ∆t + T (S,W ,∆,B)

We are interested in defining thefunction Tand examing the expected profit of thestrategy

expected profit = E [WT ] − W0

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 29: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

A TRADING STRATEGY

A trading strategy is a function T that instructs a change in theamount of stock we hold. So

∆t+1 = ∆t + T (S,W ,∆,B)

We are interested in defining thefunction Tand examing the expected profit of thestrategy

expected profit = E [WT ] − W0

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 30: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

EXAMPLE STRATEGIES

BUY UNCONDITIONAL

T (S,W ,∆,B) = 1

BUY LOW – SELL HIGH

T (S,W ,∆,B) =

1 if St < αS00 if αS0 ≤ St ≤ βS0−1 if St > βS0

with α < 1 and β > 1.

Click on the binder icon to see these strategies in action:

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 31: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

EXAMPLE STRATEGIES

BUY UNCONDITIONAL

T (S,W ,∆,B) = 1

BUY LOW – SELL HIGH

T (S,W ,∆,B) =

1 if St < αS00 if αS0 ≤ St ≤ βS0−1 if St > βS0

with α < 1 and β > 1.

Click on the binder icon to see these strategies in action:

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 32: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

EXAMPLE STRATEGIES

BUY UNCONDITIONAL

T (S,W ,∆,B) = 1

BUY LOW – SELL HIGH

T (S,W ,∆,B) =

1 if St < αS00 if αS0 ≤ St ≤ βS0−1 if St > βS0

with α < 1 and β > 1.

Click on the binder icon to see these strategies in action:

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 33: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

REAL WORLD SCENARIOS

HOLD ON ...

This is just a mathematical model.

Strategies that prove effective herecould be catastrophic in the real worldClick the icon to see performance in thereal world!

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 34: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

REAL WORLD SCENARIOS

HOLD ON ...

This is just a mathematical model.Strategies that prove effective herecould be catastrophic in the real world

Click the icon to see performance in thereal world!

Paul Johnson Mathematical Models in Finance: Trading Strategies

Page 35: Mathematical Models in Finance: Trading Strategies...Paul Johnson Mathematical Models in Finance: Trading Strategies. A TRADINGSTRATEGY A trading strategy is a function T that instructs

REAL WORLD SCENARIOS

HOLD ON ...

This is just a mathematical model.Strategies that prove effective herecould be catastrophic in the real worldClick the icon to see performance in thereal world!

Paul Johnson Mathematical Models in Finance: Trading Strategies