24
Bayesian Adaptive Trading with a Daily Cycle CHEN RONG ZHANG WEN JUN

CHEN RONG ZHANG WEN JUN. Introduction and Features Price model including Bayesian update Optimal trading strategies Coding Difficulties and

Embed Size (px)

Citation preview

Page 1: CHEN RONG ZHANG WEN JUN.  Introduction and Features  Price model including Bayesian update  Optimal trading strategies  Coding  Difficulties and

Bayesian Adaptive Trading with a Daily Cycle

CHEN RONG ZHANG WEN JUN

Page 2: CHEN RONG ZHANG WEN JUN.  Introduction and Features  Price model including Bayesian update  Optimal trading strategies  Coding  Difficulties and

Introduction and Features

Price model including Bayesian update

Optimal trading strategies

Coding

Difficulties and Justification

Outline

Page 3: CHEN RONG ZHANG WEN JUN.  Introduction and Features  Price model including Bayesian update  Optimal trading strategies  Coding  Difficulties and

Presents a model for price dynamics and optimal trading that explicitly includes the daily trading cycle and the trader’s attempt to learn the targets of other market participants

Motivation:

1. Institutional trading has an explicit daily cycle based on the assumption that at the beginning of each day each informed market participant is given a trader target exogenously.

2. Popularity of execution algorithms that adapt to changes in price of the asset being traded, either by accelerating execution when the price moves in the trader’s favor, or conversely.

Introduction

Page 4: CHEN RONG ZHANG WEN JUN.  Introduction and Features  Price model including Bayesian update  Optimal trading strategies  Coding  Difficulties and

The informed participants do not know each others’ targets, but must guess them by observing price dynamics throughout the day. We consider they will use all available information to compete with each other.

The daily cycle is an essential feature of this model.

The underlying drift factor is approximately constant throughout the day.

The trader must never sell as part of a buy program.

Features

Page 5: CHEN RONG ZHANG WEN JUN.  Introduction and Features  Price model including Bayesian update  Optimal trading strategies  Coding  Difficulties and

Price S(t) obeying an arithmetic random walk

is standard Brownian motion, σ is an absolute volatility and α a drift.

Drift:

Price Model(including Bayesian update)

2( , ) N

0( ) ( ) 0S t S t B t for t ( )B t

Page 6: CHEN RONG ZHANG WEN JUN.  Introduction and Features  Price model including Bayesian update  Optimal trading strategies  Coding  Difficulties and

At time t, stock price trajectory :

Conditional on the value of α, the distribution of S(t) is

After some calculation we can find the unconditional distribution

Bayesian Inference

( ) 0S for t

20( ) ( , )S t S N t t

2 20( ) ~ ( ,( ) )S t S N t v t t

Page 7: CHEN RONG ZHANG WEN JUN.  Introduction and Features  Price model including Bayesian update  Optimal trading strategies  Coding  Difficulties and

We then use Bayes’ rule

Obtain this conditional distribution

This represents our best estimate of the true drift α

Bayesian Inference

Pr( ( ) | ) Pr( )Pr( | ( ))

Pr( ( ))

S tS t

S t

2 2 220

2 2 2 2

( ( ) )~ ( , )

v S t SN v

v t v t

Page 8: CHEN RONG ZHANG WEN JUN.  Introduction and Features  Price model including Bayesian update  Optimal trading strategies  Coding  Difficulties and

Order of X shares, begins at t=0 and completed by

Trading trajectory fn: x(t) is the shares remaining to buy with x(0)=X and x(T)=0

Corresponding trading rate Constraint:

Use a linear market impact function to get the actual execution price:

η is the coefficient of temporary market impact

Trading and Price Impact

( ) /v t dx dt( ) 0

0 ( )

v t

x t X

( ) ( ) ( ), 0S t S t v t

t T

Page 9: CHEN RONG ZHANG WEN JUN.  Introduction and Features  Price model including Bayesian update  Optimal trading strategies  Coding  Difficulties and

C: total cost of executing the buy program relative to the initial value

C is a random variable

Trading and Price Impact

0

0

2

0 0 0

( ) ( )d

( ) ( ) ( ) ( )

T

T T T

C S t v t t XS

x t dB t v t dt x t dt

Page 10: CHEN RONG ZHANG WEN JUN.  Introduction and Features  Price model including Bayesian update  Optimal trading strategies  Coding  Difficulties and

Minimize the expectation of trading cost Conditional on the true value of α

Our best estimate at time t for α is:

Optimal Trading Strategies

2

0 0

( ) ( ) ( )T T

E C t dt x t dt

2 20

* 2 2

( )( , )

S St S

t

Page 11: CHEN RONG ZHANG WEN JUN.  Introduction and Features  Price model including Bayesian update  Optimal trading strategies  Coding  Difficulties and

The expected cost of the remaining program:

Trading goal: determine such that

Optimal Trading Strategies

2*( , ( ), , ( ) ) ( ) ( , ) ( )

T T

t t

E t x t S x d t S x d

( )x for t T

( )min ( , ( ), , ( ) )xE t x t S x

Page 12: CHEN RONG ZHANG WEN JUN.  Introduction and Features  Price model including Bayesian update  Optimal trading strategies  Coding  Difficulties and

Small perturbation:

Associate trade rate perturbation: Perturbation in cost:

Here is the best available drift estimate using information at time t

Trajectories by Calculus of Variations

( ) ( ) ( )x x x for t T

'( ) ( )x

*

''*

2 ( ) ( ) ( )

( 2 ( ) ) ( )

T T

t t

T

t

E v v d x d

x x d

* *( , ( ))t S t

( ) ( ) 0x t x T

Page 13: CHEN RONG ZHANG WEN JUN.  Introduction and Features  Price model including Bayesian update  Optimal trading strategies  Coding  Difficulties and

Unconstrained trajectories Optimizing satisfy the ODE:

Solution : (1)

Corresponding instantaneous rate:

(2)

Trajectories by Calculus of Variations

'' *( ) ,2

x t T

*( ) ( ) ( )( ),4

Tx x t t T t T

T t

' *( )( , ) ( ) | ( )

4

t

x tv t x x T t

T t

( )x

Page 14: CHEN RONG ZHANG WEN JUN.  Introduction and Features  Price model including Bayesian update  Optimal trading strategies  Coding  Difficulties and

Constrained trajectories There is a critical drift value such thatIf , then the constraint is not

binding. The solution is the one given in (1) and (2).

If , then the solution is the one of (1,2), with a shortened end time determined by

Trajectories by Calculus of Variations

c

*| | c

* c *T T

*

4 ( )*

2

4 ( )( ( ), )

( )

x t

c

T t

x tx t T t

T t

Page 15: CHEN RONG ZHANG WEN JUN.  Introduction and Features  Price model including Bayesian update  Optimal trading strategies  Coding  Difficulties and

If , then the solution is the one of (1,2), except that trading does not begin until a starting time determined by:

Trajectories by Calculus of Variations

* c

*t t

**

4 ( )x tT t

Page 16: CHEN RONG ZHANG WEN JUN.  Introduction and Features  Price model including Bayesian update  Optimal trading strategies  Coding  Difficulties and

The overall trade rate formula:

(3)

This is the Bayesian adaptive strategy: a specific formula for the instantaneous trade rate as a function of price, time, and shares remaining.

Trajectories by Calculus of Variations

*

*

**

** *

*

0,

( , , ) ( ), | |4

( ) ,4

c

c

c

xv t x S T t

T t

xxT t

T t

Page 17: CHEN RONG ZHANG WEN JUN.  Introduction and Features  Price model including Bayesian update  Optimal trading strategies  Coding  Difficulties and

Illustration Constrained Solution Starting at Time t

with Shares x(t) and Drift Estimate α ( )x

Page 18: CHEN RONG ZHANG WEN JUN.  Introduction and Features  Price model including Bayesian update  Optimal trading strategies  Coding  Difficulties and

For , the trajectories go below the linear profile to reduce expected purchase cost.

For , the constraint is not binding (shaded region).

At the solution become tangent to line x=0 at and for larger values they hit x=0 with zero slope at

For , trading does not begin until

Illustration

0

| | c

c T

*T T

c *t t

Page 19: CHEN RONG ZHANG WEN JUN.  Introduction and Features  Price model including Bayesian update  Optimal trading strategies  Coding  Difficulties and

Coding Implement the price model using Bayesian

adaptive strategy by MATLAB Mean Standard deviation , then Price path with volatility Initial price Initial shares Impact coefficient

0.7 1

( ),0 1S t t 1.5

(0.7,1)N

0 $100S

0.07

1X

Page 20: CHEN RONG ZHANG WEN JUN.  Introduction and Features  Price model including Bayesian update  Optimal trading strategies  Coding  Difficulties and

Coding

Sample price path with initial price

0 $100S

Page 21: CHEN RONG ZHANG WEN JUN.  Introduction and Features  Price model including Bayesian update  Optimal trading strategies  Coding  Difficulties and

Coding

Trajectories according to sample price path

Page 22: CHEN RONG ZHANG WEN JUN.  Introduction and Features  Price model including Bayesian update  Optimal trading strategies  Coding  Difficulties and

In this model, the random daily drift is superimposed on the price volatility caused by small random traders.

In theory, these two sources of randomness can be disentangled by measuring volatility on an intraday time scale and comparing it to daily volatility.

In practice, real price processes are far from Gaussian, so it’s difficult to do this comparison with any degree of reliability.

Difficulties

Page 23: CHEN RONG ZHANG WEN JUN.  Introduction and Features  Price model including Bayesian update  Optimal trading strategies  Coding  Difficulties and

By the practical observation, some fraction of traders do express interest in using strategies similar to ours.

We provide a conceptual framework for designing optimal strategies that capture this preference.

Without any such framework it’s impossible to design algorithms except by completely special methods.

Justification

Page 24: CHEN RONG ZHANG WEN JUN.  Introduction and Features  Price model including Bayesian update  Optimal trading strategies  Coding  Difficulties and

Q & A