Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

STA 2536 Project - 4:  Reinforcement Learning for Statistical Arbitrage

Suppose that the mid-price of an asset price (St)t=0,1,...,T  evolves in (discrete) time as follows St = θ + (St 1 _ θ) e κ + η Zt

where {Z1 , . . . , ZT } are iid and Z1  ~ Ⅳ (0, 1).  Hence, S is a discrete version of an Ornstein-Uhlenbeck process.

Furthermore, assume that the spread of the asset price is ∆ > 0 – i.e., the best bid price is St  _ ∆ and the best ask price is St + ∆ . Thus, when you buy an asset you pay St + ∆ but when you sell it you receive St _ ∆ .

You are to develop an optimal trading strategy that aims to maximise the profit of a trader.  The trader takes actions qt  e {_Q, _Q + 1, . . . , +Q} which represent their inventory position at a point in time t = 0, 1, . . . , T _ 1 (held constant until time t+1). At T they must liquidate all assets in the portfolio, and thus they must have qT  = 0.

As well, when the trader sends an order to the market, that action modifies the price evolution to the

following:

St = θ + (St − 1 _ θ) κ + β sgn(qt _ qt 1 ) ^|qt _ qt 1 | +η Zt

↘                                                                                                               -

trading impact

The additional term represents the impact that the traders actions have on price evolution – so that buying many shares pushes the price up, and selling many shares pushes the price down. The figure below shows a single sample path (in blue), the confidence bands (in dashed black), some sample paths (light multi colored), for a strategy that sells the asset from time 0 to time 5 and then stops trading all together.  Notice how the price is pushed down (even though it started at the mean-reversion level) and then after trading it mean revers back.

As expected, the single-period rewards for trading is

rt = qt(St+1 _ St) _ [(qt _ qt 1 )St + ∆|qt _ qt 1 |].

The first term represents the change in the book value of the shares that you hold over the period, while the second term represents the cost of changing your position from qt 1  to qt .

Use the base set of parameters

S0 = 1,    θ = 1,    κ = 0.5,    η = 0.02,    β = 0.01,    Q = 10.

Develop a double deep Q-learning approach to optimise the expected sum of rewards (i.e., the discount factor is 1). Make sure to randomise your initial inventory and price when running the algorithm.

Make plots of the optimal strategy through time, as well as develop an approach to visualize how the optimal strategy various as a function of time, price, and inventory.

Investigate the role of the various parameters: κ , β, and η .