### Bayesian Adaptive Trading with a Daily Cycle

```CHEN RONG
ZHANG WEN JUN

Introduction and Features

Price model including Bayesian update

Optimal trading strategies

Coding

Difficulties and Justification




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.




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.

Price S(t) obeying an arithmetic random walk
S (t )  S0  t   B(t )
for t  0
B(t ) is standard Brownian motion, σ is an
absolute volatility and α a drift.

Drift:

N ( , 2 )

At time t, stock price trajectory :
S ( ) for 0    t

Conditional on the value of α，the
distribution of S(t) is
S (t )  S0

N (t ,  2t )
After some calculation we can find the
unconditional distribution
S (t )  S0 ~ N (t,(  v t )t )
2
2

We then use Bayes’ rule
Pr( S (t ) |  )  Pr( )
Pr( | S (t )) 
Pr( S (t ))

Obtain this conditional distribution
 2  v2 (S (t )  S0 )  2
2
 ~ N(
,
v
)
2
2
2
2
 v t
 v t

This represents our best estimate of the true
drift α




Order of X shares, begins at t=0 and
completed by t  T  
Trading trajectory fn: x(t) is the shares
remaining to buy with x(0)=X and x(T)=0
Corresponding trading rate v(t )  dx / dt
Constraint: v (t )  0
0  x (t )  X

Use a linear market impact function to get the
actual execution price:
S (t )  S (t ) v(t ),   0
η is the coefficient of temporary market impact

C: total cost of executing the buy program
relative to the initial value
T
C   S (t )v(t ) d t  XS 0
0
T
T
T
0
0
0
   x(t )dB (t )    v (t ) 2 dt    x (t )dt

C is a random variable


Minimize the expectation of trading cost
Conditional on the true value of α
T
T
0
0
E (C )    (t ) 2 dt    x(t )dt

Our best estimate at time t for α is:
 2  2 ( S  S0 )
* (t , S ) 
 2   2t

The expected cost of the remaining program:
T
T
t
t
E(t , x(t ), S , x( ))    ( ) 2 d  * (t, S )  x( )d

Trading goal: determine x( ) for t    T such
that
min E (t , x(t ), S ,  x( ))
x ( )



Small perturbation: x( )  x( )   x( ) for t    T
 x(t )   x(T )  0
Associate trade rate perturbation:  ( )   x' ( )
Perturbation in cost:
T
T
t
t
 E    2v( ) v( )d   *   x( ) d
T
  (2 x '' ( )  * ) x( ) d
t

Here *  * (t, S (t )) is the best available drift
estimate using information at time t
Unconstrained trajectories
 Optimizing x( ) satisfy the ODE:
*
x ( ) 
, t   T
2
''

*
T 
x(t )  (  t )(T   ), t    T (1)
Solution : x( ) 
T t
4

Corresponding instantaneous rate:
x(t ) *
v(t , x)   x ( ) | t 
 (T  t )
T  t 4
'
(2)
Constrained trajectories
 There is a critical drift value  c such that
 If | * |  c , then the constraint is not binding.
The solution is the one given in (1) and (2).
 If *  c , then the solution is the one of
(1,2), with a shortened end time T*  T
determined by
T*  t 
4 x ( t )
*
4 x(t )
 c ( x(t ), T  t ) 
(T  t )2

If *   c , then the solution is the one of
(1,2), except that trading does not begin until
a starting time t*  t determined by:
T  t* 
4 x(t )
*

The overall trade rate formula:


*   c
0,
 x
*

v(t , x, S )  
 (T  t ),
|* |  c
 T  t 4

* x

x
*

 (T*  t ) 
, *   c
 T*  t 4

(3)
This is the Bayesian adaptive strategy: a specific formula for
the instantaneous trade rate as a function of price, time, and
shares remaining.

Constrained Solution x( ) Starting at Time t
with Shares x(t) and Drift Estimate α




For   0 , the trajectories go below the linear
profile to reduce expected purchase cost.
For |  | c , the constraint is not binding
(shaded region).
At   c the solution become tangent to line
x=0 at   T and for larger values they hit x=0
with zero slope at   T*  T
For   c , trading does not begin until   t*  t







Implement the price model using Bayesian
adaptive strategy by MATLAB
Mean   0.7
Standard deviation   1 , then  N (0.7,1)
Price path S (t ),0  t  1 with volatility   1.5
Initial price S0  \$100
Initial shares X  1
Impact coefficient   0.07
Sample price path with initial price S0  \$100
Trajectories according to sample price path



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.



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.
Q&A
```