Bayesian Adaptive Trading with a Daily Cycle

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

description

Bayesian Adaptive Trading with a Daily Cycle. CHEN RONG ZHANG WEN JUN. O utline. Introduction and Features Price model including Bayesian update Optimal trading strategies Coding Difficulties and Justification. Introduction. - PowerPoint PPT Presentation

Transcript of Bayesian Adaptive Trading with a Daily Cycle

Page 1: Bayesian Adaptive Trading with a Daily Cycle

Bayesian Adaptive Trading with a Daily Cycle

CHEN RONG ZHANG WEN JUN

Page 2: Bayesian Adaptive Trading with a Daily Cycle

Introduction and Features

Price model including Bayesian update

Optimal trading strategies

Coding

Difficulties and Justification

Outline

Page 3: Bayesian Adaptive Trading with a Daily Cycle

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: Bayesian Adaptive Trading with a Daily Cycle

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: Bayesian Adaptive Trading with a Daily Cycle

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: Bayesian Adaptive Trading with a Daily Cycle

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: Bayesian Adaptive Trading with a Daily Cycle

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: Bayesian Adaptive Trading with a Daily Cycle

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( ) 00 ( )v tx t X

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

t T

Page 9: Bayesian Adaptive Trading with a Daily Cycle

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: Bayesian Adaptive Trading with a Daily Cycle

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 St

Page 11: Bayesian Adaptive Trading with a Daily Cycle

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: Bayesian Adaptive Trading with a Daily Cycle

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: Bayesian Adaptive Trading with a Daily Cycle

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 TT t

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

tx tv t x x T tT t

( )x

Page 14: Bayesian Adaptive Trading with a Daily Cycle

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 tT t

Page 15: Bayesian Adaptive Trading with a Daily Cycle

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: Bayesian Adaptive Trading with a Daily Cycle

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 tT t

xx T tT t

Page 17: Bayesian Adaptive Trading with a Daily Cycle

Illustration Constrained Solution Starting at Time t

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

Page 18: Bayesian Adaptive Trading with a Daily Cycle

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

Illustration0

| | c

c T

*T T

c *t t

Page 19: Bayesian Adaptive Trading with a Daily Cycle

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: Bayesian Adaptive Trading with a Daily Cycle

Coding

Sample price path with initial price

0 $100S

Page 21: Bayesian Adaptive Trading with a Daily Cycle

Coding

Trajectories according to sample price path

Page 22: Bayesian Adaptive Trading with a Daily Cycle

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: Bayesian Adaptive Trading with a Daily Cycle

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: Bayesian Adaptive Trading with a Daily Cycle

Q & A