Deep reinforcement learning for optimal trading with partial information

Extracted source text · arXiv 2511.00190

\documentclass[10pt,a4paper]{article}

\usepackage[margin=1in]{geometry}
\usepackage{placeins}
\usepackage{comment}
\usepackage[utf8]{inputenc}
\usepackage[italian=guillemets]{csquotes}
\usepackage[english]{babel}
\usepackage[style=authoryear]{biblatex}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{lmodern}
\usepackage{hyperref}
\usepackage{braket}
\usepackage{tikz}
\usepackage[T1]{fontenc}
\usepackage{enumitem}
\usepackage{amsmath}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage[toc,page]{appendix}
\usepackage{subcaption}
\usepackage{appendix}
\usepackage{todonotes}
\usepackage{booktabs}
\usepackage[normalem]{ulem}
\usetikzlibrary{decorations.pathreplacing}
\definecolor{darkgreen}{RGB}{100,200,0}


\newcommand{\Emmett}[5]{
  \draw[#4] (0,-2)
  \foreach \x in {1,...,#1}
    { -- ++(#2,rand*#3) }
  node[right] {#5};
}

\newcommand{\seb}[2][]
{\todo[caption={#2}, fancyline, color=red!10, size=\scriptsize, #1]{\renewcommand{\baselinestretch}{0.75}\selectfont#2\par}}

\newcommand{\andre}[2][]
{\todo[caption={#2}, fancyline, color=blue!10, size=\scriptsize, #1]{\renewcommand{\baselinestretch}{0.75}\selectfont#2\par}}


\addbibresource{biblio.bib}

\input{preamble}

\usepackage{tabularx}


\begin{document}

\title{Deep reinforcement learning for optimal trading with partial information}
\author{Andrea Macr\`i$\,^{1}$\footnote{andrea.macri@sns.it} , Sebastian Jaimungal$\,^{2, 3}$ and Fabrizio Lillo$^{\,1,4}$ \\
\\                              
\small{$^1$ Scuola Normale Superiore, Pisa}\\
\small{$^2$ Department of Statistical Sciences, University of Toronto}\\
\small{$^3$ Oxford-Man Institute for Quantitative Finance, University of Oxford}\\
\small{$^4$ Dipartimento di Matematica, University of Bologna}}
%\date{September 20th, 2025}
\maketitle
\begin{abstract}
    Reinforcement Learning (RL) applied to financial problems has been the subject of a lively area of research. The use of RL for optimal trading strategies that exploit latent information in the market is, to the best of our knowledge, not widely tackled. In this paper we study an optimal trading problem, where a trading signal follows an Ornstein–Uhlenbeck process with regime-switching dynamics. We employ a blend of RL and Recurrent Neural Networks (RNN) in order to make the most at extracting underlying information from the trading signal with latent parameters. 

    The latent parameters driving mean reversion, speed, and volatility are filtered from observations of the signal, and trading strategies are derived via RL. To address this problem, we propose three Deep Deterministic Policy Gradient (DDPG)–based algorithms that integrate Gated Recurrent Unit (GRU) networks to capture temporal dependencies in the signal. The first, a one-step approach (hid-DDPG), directly encodes hidden states from the GRU into the RL trader. The second and third are two-step methods: one (prob-DDPG) makes use of posterior regime probability estimates, while the other (reg-DDPG) relies on forecasts of the next signal value. Through extensive simulations with increasingly complex Markovian regime dynamics for the trading signal's parameters, as well as an empirical application to equity pair trading, we find that prob-DDPG achieves superior cumulative rewards and exhibits more interpretable strategies. By contrast, reg-DDPG provides limited benefits, while hid-DDPG offers intermediate performance with less interpretable strategies. Our results show that the quality and structure of the information supplied to the agent are crucial: embedding probabilistic insights into latent regimes substantially improves both profitability and robustness of reinforcement learning–based trading strategies. 
\end{abstract}

\section{Introduction}
Optimal trading strategies have been the subject of an active and flourishing area of research since the advent of electronic markets several decades ago. The development of more efficient quoting systems and the faster spread of information have led major market participants, on both sell and buy sides, to embed ever more granular information into their trading algorithms. 

In model-based approaches to algorithmic trading, recent work includes the incorporation of trading signals into the classical optimal stochastic control formulation of trading, starting with the works of \cite{garleanu2013dynamic} in discrete time and \cite{cartea2016incorporating} and \cite{casgrain2019trading} (with latent signals) in continuous time.
Thanks to the advent of machine learning (ML), research has begun to focus on model-agnostic approaches to incorporate trading signals. In this regard, among the many methods proposed in literature, those that propose forecasting algorithms that  use  Recurrent Neural Networks (RNNs) show the greatest promise. For example, \cite{tsantekidis2020using}, investigate many architectures for  predicting future price levels starting from Limit Order Book  (LOB) information; \cite{sirignano2021universal} where the authors use 
high frequency data containing all orders, transactions and order cancellations for approximately 1000 stocks traded on NASDAQ to predict their returns; \cite{zhang2019deeplob} propose a new convolutional neural network on top of an LSTM layer to forecast stock returns at high frequency and finally \cite{kolm2023deep} where the authors compare the performance of several machine learning architectures in extracting excess return information for multiple horizons. Extracting market signals, however, is only one side of the problem, the other side is how to use those signals for optimal trading.

Another stream of literature employs deep reinforcement learning to directly seek optimal trading policies, or strategies, that maximise profits. For example, \cite{ning2021double} use double deep Q-networks (DDQN) for optimal execution problems and \cite{casgrain2022deep} extends it to the multi-agent RL paradigm\footnote{The first versions of these works appeared online in 2018 and 2019.}; \cite{zhang2019deep} compares different paradigms of RL against classical time series momentum strategies on optimal futures trading, showing how RL-based methods outperform such baseline models; \cite{yang2020deep} trains an RL agent that makes use of an `ensemble' strategy --  an ensemble of trading strategies that uses three actor-critic based algorithms: Proximal Policy Optimisation (PPO), Advantage Actor Critic (A2C), and Deep Deterministic
Policy Gradient (DDPG). This  particular combined architecture enables the agent to inherit and integrate the best features of all three algorithms, thus robustly
adjusting to different market situations. \cite{cartea2023reinforcement} use DDQN and develop a new reinforced deep Markov model (RDMM) for statistical arbitrage.  Finally,  \cite{briola2023deep} start from an environment based on LOBs for a particular stock, and train a PPO agent to trade one unit of asset per time step, leading the agent to learn trading strategies that deliver stable positive returns in a highly stochastic and non-stationary environment.
This stream of literature is quite active  and thus many other methods have been developed to tackle other kind of problems when it comes to asset trading. For a more complete review of the methods available please refer to \cite{millea2021trading,zou2023stock, hambly2023recent}.

To the best of our knowledge, however, none of the existing literature makes use of latent information embedded in a signal process as part of training for an RL agent and to use this to obtain optimal trading strategies.
Thus, in this paper, we fill this gap in the literature by training an RL agent whose goal is to optimally trade a signal, hence maximizing their future discounted rewards from trading by making use of hidden information coming from the signal itself. 
We model the trading signal as a mean-reverting process; in this context, the information embedded in the training of the agent comes in the form of the probability of mean reversion to one of the different long-run regimes to which the signal mean reverts to. We progressively consider more complicated signal dynamics and show how embedding information in the form of the probability of mean reversion to a regime improves dramatically the performance of the RL agent both in a simulated environment and with real data.
In this paper, we develop and test three DDPG-based algorithms to solve an optimal trading problem with mean-reverting signals governed by Markov chains. We incorporate GRU networks to capture the time-dependent structure of the trading signal, leveraging on this we explore different ways of feeding information to the RL agent. Our findings show that providing posterior probability estimates of the underlying mean-reversion regimes consistently yields the highest rewards, both in synthetic environments with multiple regime dynamics and in real market pair-trading data. In contrast, supplying next-step signal forecasts adds little benefit, while using GRU hidden states provides intermediate performance. Overall, the results highlight that the quality and type of information provided to the agent is crucial: Interpretable structured insights into the data-generating process substantially improve the effectiveness and robustness of the learning.

The paper is organised as follows, in Section 2 we define the trading problem tackled throughout the remainder of the paper, in Section 3 introduces the methods used to model the trading problem, Section 4 discusses the results for different model scenarios with simulated data, Section 5 discusses the results obtained by applying the algorithms to real data, and finally, Section 6 provides conclusions and outlines further research directions.

\section{Optimal trading problem}
\label{sec:model}
\subsection{Market model}

A risk-neutral investor aims to maximise her expected discounted profits from trading a signal $(S_t)_{\tT}$.
We assume that $S_t$ follows an Ornstein-Uhlenbeck process with time varying parameters, thus it satisfies the stochastic differential equation (SDE):
\begin{equation}
\label{eqn:OU-SDE}
   \dS_t = \kappa_t (\theta_t- S_t) \,\dt + \sigma_t \, \dW_t \,,
\end{equation}
where $W=(W_t)_{\tT}$  is a Brownian motion in a suitable probability space and the parameters $\kappa_t\ge0$, $\theta_t>0$, and $\sigma_t>0$ are, respectively, the long run mean at which the process mean reverts to, the velocity of mean reversion, and the volatility of the process at time $t$.

The existence of mean reversion creates opportunities for signal forecasting and therefore for profitable trading strategies, because when the signal is  above/below the long term value $\theta_t$, then for the agent it is optimal to go short/long on the signal. The parameters, however, are generally latent and must be estimated dynamically together with the optimization of the strategy. To overcome this issue, we take the approach from partial information stochastic control and filter $\theta_t$, $\kappa_t$, $\sigma_t$ from the observations of the dynamics of $(S_u)_{u\in[0,t]}$.

To gain some insight, consider the case where $\kappa_t$ and $\sigma_t$ are constant, while $\theta_t$ follows some unknown dynamics. In this case, the solution to SDE~\eqref{eqn:OU-SDE} may be written as
\begin{equation}
    S_{t+\Delta t} = e^{-\kappa\,\Delta t}\,S_t + \kappa \int_t^{t+\Delta t} e^{-\kappa(t-u)}\,\theta_u\, \du + \sigma\int_t^{t+\Delta t} e^{-\kappa(t-u)}\,\dW_u\,.
    \label{eqn:sde-sol}
\end{equation}
As expected, there is a strong dependence of $S_{t+\Delta t}$ on the level of $\theta_t$. Moreover, the expected change in the price  is given by
\begin{align}
\begin{split}
    \label{eqn:OU-relation}
    \E[S_{t+\Delta t}-S_t\,|\,\F_t]
    &= (e^{-\kappa\,\Delta t}-1)\,S_t 
    + \kappa \int_t^{t+\Delta t} e^{-\kappa(t-u)}\,\E[\theta_u\,|\,\F_t]\,\, \du
    \\
    &\approx \kappa\,\Delta t\,\left(\E[\theta_t\,|\,\F_t]-S_t \right) + o(\Delta t).
\end{split}
\end{align}

The relationship in Eq.~\eqref{eqn:OU-relation} shows how the expected increase in $S_t$ is related to the expected level of $\theta_t$ conditioned on the filtration $\F_t$ generated by $S_t$. In this paper, we  consider a setting where a risk neutral agent maximizes the expected discounted profit from trading over a finite time horizon
when the dynamics of the signal is given by Eq.~\eqref{eqn:OU-SDE} and the parameters $\theta_t$, $\kappa_t$, and $\sigma_t$ are driven by a regime switching Markov chain. Moreover, we implement a Deep Reinforcement Learning (RL) approach to solve the optimization problem by considering a discretized version of the dynamics in Eq.~\eqref{eqn:OU-SDE}.

More specifically, we discretize the time in length intervals $\tau$ and we index the discrete time steps with the integer numbers, $t=0,1,2,...$.
At the start of the trading window ($t=0$), the agent has an initial endowment of inventory $I_0$. The agent's action is identified with the new position she wishes to hold, i.e. $a_t = I_{t+1}$, and the  volume of trades is\footnote{Positive (negative) values of $q_t$ correspond to purchases (sales).} $q_t = I_{t+1} - I_{t}, \,\,  \forall\,\,t \in {\mathbb N}$. 
Whenever the trader performs a trade of volume $q_t$, she pays a transaction cost per unit volume of $\lambda\ge0$. As a result, the reward $r_t$ from the trading action at time $t$ is
\begin{equation}
    \label{eq:reward}
    r_t(q_t, S_t,S_{t+1}, \lambda) := I_{t+1} \,(S_{t+1} - S_{t}) - \lambda \,|q_t|\,.
\end{equation}
This reward represents the change in the trader's gains process accounting for transaction fees.

The trader's performance criterion is the expected future discounted sum of rewards
\[
\E \left[ \sum^{\infty}_{t=0} \gamma^t \,r_t(q_t, S_t,S_{t+1}, \lambda) \;\Big|\; I_0, S_0\right]\,,
\]
where $\gamma\in(0,1)$ is a discount factor. The trader aims to optimise this criterion over $\F$-adapted admissible strategies $(q_t)_{\tT}$ that are square integrable, denoted $\mcA$, i.e., the trader aims to find the strategy that optimizes 
\begin{equation}
\label{eq:max_pb}
   \max_{(q_t)_{\tT}\in\mcA} \E \left[ \sum^{\infty}_{t=0} \gamma^t \,r_t(q_t, S_t,S_{t+1}, \lambda) \;\Big|\; I_0, S_0\right]\,.
   \tag{P1}
\end{equation}
Problem~\eqref{eq:max_pb} is an infinite time horizon problem, and we seek stationary strategies that depend only on the state of environment at that time, and not explicitly on time. 

As mentioned above, each parameter  $\theta_t$, $\kappa_t$, and $\sigma_t$ follows an independent regime switching Markov chain. More precisely, we consider increasingly more complex dynamics for $S_t$. Where only $\theta_t$ follows a regime switching Markov chain dynamics; next, where both $\theta_t$, $\kappa_t$ follow regime switching  dynamics; and finally, where all $\theta_t$, $\kappa_t$, and $\sigma_t$ follows regime switching dynamics. 

In the first setting, $\theta_t$ has three regimes $\theta_t\in\{\phi_1,\phi_2, \phi_3\}$ and the switching between the regimes is modelled using a Markov chain with transition rate matrix $A$, so that:
\begin{equation}
    \P(\theta_{t}=\phi_j|\theta_{t-1}=\phi_i)
    = [e^{A\tau}]_{ij}\,
    \label{eq:prob}
\end{equation}

We next consider the case where also the speed of mean reversion $\kappa_t$ follows an independent two state Markov chain with $\kappa_t\in\{\psi_1,\psi_2\}$, corresponding to slow and fast relaxation to the mean.
Finally, we allow for regime switching volatility, with $\sigma_t\in\{\xi_1,\xi_2\}$, and again the Markov chain is independent from the other two. Such dynamics is quite complicated and difficult to filter from the mere observation of $S_t$ levels. 

To simplify the presentation, in the following we  detail the case where only the mean reversion level $\theta_t$ follows a Markov chain, while $\kappa$ and $\sigma$ are constant. The generalization to the more complex cases is straightforward and the numerical results are shown for all models.

\section{Learning Algorithms}

As in any optimization setting with latent and time-varying parameters, the problem faced by the algorithm is two-fold. The first consists in using the observed data to filter the latent parameters, while the second consists in finding the optimal action given the current estimate of the parameters. Here we consider and compare two approaches --- one where we optimize the criterion without directly filtering the states of the system, and the second where we first develop a filter and then use the filtered states as part of the optimization. The optimal trading problem can, therefore, be cast either as a unique optimization or as two consecutive optimizations

Specifically, we first propose a one-step algorithm, using as features the path of the signal process and the current inventory and returns the optimal action --- which treats the filtering and optimal trading problems simultaneously. We then consider a two-step approach, where we first train a model to determine posterior probabilities for the latent $\theta_t$ parameter from the paths of the observable signal process $S_t$, and then use the posterior probabilities, together with the current signal and inventory, to find the optimal trading action. As a third benchmark case, we also consider the case where the filtering part forecasts the next value of the trading signal, instead of the posterior probabilities, which is then used as feature in the part of the algorithm responsible of the trading action. In these last two settings the filtering and optimal trading are performed separately. Moreover, the setting where posterior probabilities are initially learned requires the knowledge of the true state of the latent process, a characteristic that is typically not available in real settings. 

From an architectural point of view, we employ a Gated Recurrent Unit (GRU) network (introduced in \cite{cho2014learning}). The GRU network is a Recurrent Neural Network able to to encode time dependency and thus deal with time series. One could also employ, e.g., long-short term memory processes or self-attention and other variants.

To approximate the optimal trading policy we employ, as anticipated, Deep Reinforcement Learning, more specifically we use a Deep Deterministic Policy Gradient (DDPG) algorithm, first introduced by \cite{lillicrap2015continuous}, which employs an Actor-Critic approach. The algorithm makes use of two distinct neural networks, an Actor network $\pi$ that is responsible to choose the action to perform, based on the state of the environment, and a Critic network $Q$ that evaluates the `quality' of the action chosen using the network $\pi$ given the state of the environment. 
For each of the algorithm proposed we train the RL agent over a number $N$ of training episodes.
In our setting, the agent is tasked with the objective of maximising the rewards obtained by rebalancing the inventory holdings $I$ as 
defined in Eq. \eqref{eq:reward}. The agent's actions consist of the new level of inventory to be held. Thus, the agent seeks to learn the optimal rebalancing their level of inventory depending on the signal process $S_t$. After the $N$ trading episodes we test what the agent has learnt by feeding other $M$
episodes, where the agent trades using the policy learnt during the training phase.

\subsection{States, environment, actions, and rewards}
\label{sec:actions_rewards}
While training, the agent may be at some time \(t\) with an inventory \(I_t\) and must decide how much inventory to hold at time \(t+1\), i.e., \(I_{t+1}\). The agent has access to the signal value at that time \(S_t\) and to the \(t-W\) past observations of the signal, where $W+1$ is the length of the signal window, which we denote $\{S_{u}\}^{t-W}_{u=t}$.
A visual representation of the information  available to the agent is shown in Figure~\ref{fig:signal_path}. These features/information are used to train an agent to optimize their sum of discounted rewards  using a GRU network and two variants of the DDPG algorithm --- i.e., we consider two approaches to the joint problem of filtering the signal and finding the optimal trading strategy employing this set of information about the environment available to the agent.

For training purposes, we simulate batches of size $b$ of time series for the signal $\{S_{u}\}^{t+W+1}_{u=t}$ (i.e., signal time-series of length $W+2$) and inventories $I_t$. Inventories $I_t$ are randomly sampled as $I_t  \sim {\mathcal U}_{[I_{\text{min}}, I_{\text{max}}]}$.\footnote{Where $\mathcal U$ is the uniform distribution.}

For the signal, we simulate the time series of the signal \(S_t\) of length \(W+2\), with parameters according to the setting being considered. The starting value for the signal's time series simulation is $S_{t-W} \sim  \mathcal{N}(\mu_{\text{inv}},3\,\sigma_{\text{inv}})$ 
where $\sigma_{\text{inv}} = \frac{\sigma}{2 \kappa}$ which is the invariant volatility for the Ornstein-Uhlenbeck process with time varying parameters in Eq.~\eqref{eqn:OU-SDE}, while $\mu_{\text{inv}}$ is the invariant mean of the trading signal\footnote{In the settings where \(\sigma\) and \(\kappa\) are time varying in order to compute the initial value of \(S_0\), we choose the minimal value according to the regimes used.}. 

\begin{figure}[h]
\centering
\begin{tikzpicture}[scale=2]

\draw[thick,->] (0,0) -- (5,0) node[anchor=west] {\small Time};
\draw[thick,->] (0,0) -- (0,2.2) node[anchor=south, rotate=90, xshift=-40pt] {\small Signal Value};

\foreach \x in {0,4,4.1}
  \draw[red,ultra thick] (\x,3pt) -- (\x,-3pt);

\node at (0,-0.25) {\small $t - W$};
\node at (3.95,-0.25) {\small \textcolor{darkgreen}{$t$}};
\node at (4.25,-0.25) {\small $t + 1$};

\draw[dashed,gray] (0,0) -- (0,2);
\draw[dashed,gray] (4,0) -- (4,2);
\draw[dashed,gray] (4.1,0) -- (4.1,2);

\pgfmathsetseed{1123}
\draw[thick,blue!70!black,opacity=0.9] (0,0.5)
  \foreach \x in {1,...,40}
    { -- ++(0.125,rand*0.2) };

\filldraw[blue] (4,1.252) circle (1.2pt) node[anchor=north east] {\small $S_t$};
\filldraw[red] (4.1,1.2) circle (1.2pt) node[anchor=south west] {\small $S_{t+1}$};

\draw [decorate,decoration={brace,amplitude=6pt},thick,darkgreen]
  (0.05,2) -- (4,2) node[midway,above=6pt] {\small $\{S_u\}_{u = t}^{t-W}$};

\end{tikzpicture}
\caption{Information about the signal that can be used by the agent. The agent finds itself at some time \(t\), has access to the past values of the signal from time \(t\) back to time \(t-W\) and decides how much inventory to be held at time \(t+1\).}
\label{fig:signal_path}

\end{figure}


In the testing phase, where we assess the trading policy learnt by the agent, we assume that the agent trades over a time-window of $n$ time-steps. 
We assume that the agent starts their trading at time $t =  0$ and has access to information on the past $W$ values of the signal $S$.  As time $t$ progresses, the agent uses the observations of the signal from time $t$ back to time $t-W$, in a rolling window fashion, to decide the inventory to be held at time $t+1$.
The agent can hold inventories within the interval $I\in[-I_\text{max}, I_{\text{max}}]$ and we always start the testing episodes of trading with $S_0 = 1$ and $I_0=0$.

As mentioned, we employ two main approaches: In the \emph{one-step approach} we set the states, or information about the environment, available to the agent as tuples of
$(S_t, I_{t}, o_t)$.
Here $S_t$ is the signal value at time $t$, $I_t$ is the value of the inventory held at time $t$, and $o_t$ is the output of a Recurrent Neural Network that takes as input a collection $\{S_{u}\}^{t-W}_{u=t}$
of past values of the signal from time $t-W$ up to time $t$ (see below for more details).

In the \emph{two-step approach} we decouple the filtering from the optimal trading task and consider two different settings. In the first setting, we first train the algorithm to learn the regimes from the past and current value of the signal. Specifically, the posterior probabilities $ \Phi_{t,k} := \P(\theta_t=\phi_k| \{S_{u}\}^{t-W}_{u=t})$ and $k = 1,2,3$ are learnt offline using a GRU network followed by a feed-forward network with soft-max activation output layer (to provide estimates of the posterior probability of the regime based on the historical price signal). Then the DDPG uses the tuple $(S_t, I_t, \{\Phi_{t, k}\}_{k=1,2,3})$ as features to learn the optimal trading. In the third setting, we first train the algorithm to forecast the next value of the signal $\tilde S_{t+1}$ and then the DDPG takes as input features the tuple $(S_t, I_t, \tilde S_{t+1})$.

The action that the agent can take at each time step $t$ consists of a rebalancing of her inventory, which can be a long ($I_t>0$) or short ($I_t<0$) position, and is chosen according to the algorithms described below. As a constraint, we impose that at each time, the agent holds $I_t \in  [I_{\text{min}}, I_{\text{max}}]$,  i.e. the actions that can be chosen limit $I_t$ between a maximum and a minimum inventory. 

After the action has been taken by the agent in a state of the environment at time $t$, the reward is calculated considering the subsequent change in the signal process and measuring the gain obtained by the agent trading.
The reward used is given by Eq. \eqref{eq:reward}.

In all algorithms, we let the agent explore a wide range of combinations of inventory holdings $I_t$ and possible $S_t$ values or, in the case of the two-step procedures, multiple combinations of states $(I_t, S_t, \Phi_{t, k})$ or $(I_t, S_t, \tilde S_{t+1})$. This is done through an exploration-exploitation scheme. 
Thus, during the learning procedure, the agent employs randomized actions, which is a randomized perturbation of the current policy, the exploration process controlled by an exploration parameter \(\varepsilon\) that decays as the training unfolds.

\subsection{The one-step approach}
\label{sec:methodS_one_step}

To approximate the optimal strategy for Problem~\eqref{eq:max_pb} when the dynamics of the trading signal are described by Eq.~\eqref{eqn:OU-SDE} with regime switching parameters, we first propose a one-step procedure that employs the signal's past history as part of the state of the environment that feeds into a DDPG algorithm, employing the Actor-Critic approach. To account for the time dependency of the trading signal, we encode this information using a GRU network whose output is then fed into the DDPG algorithm. A directed graph representation of the one-step approach is reported in Fig.~\ref{fig:one-step-architecture}. 

\input{architectures/onestep}

\subsubsection{The training loop}

The algorithm is trained over $N$ iterations, for each iteration we sample $b$ batches of input data that are used to train the algorithm. 
In each iteration, both the Agent and the Critic network are updated by feeding to the networks independent batches of states of the world represented by a matrix $\f \in {\mathbb R}^{b \times (W + 2)}$, where each of the $b$ rows contains a tuple of the form $(\{S_{u}\}^{t-W}_{u=t}, I_{t})$. 

\paragraph{The GRU network.}
 The architecture, shown in Figure ~\ref{fig:one-step-architecture}, is composed by $d_l\times (W+1)$ GRU units, where $d_l$ is the number of layers. The units of the first layer receive input from the data, whereas the subsequent layers receive the hidden states generated by the previous layers. { For each iteration $m=1,...,N$} the data are contained in the sub-matrix $\es \in  {\mathbb R}^{b \times (W+1)}$ of $\f$ containing the past and present $W+1$ observations of $S$, which will be encoded using a GRU network. The GRU has fewer parameters than the LSTM (which has three gates), leading to lower memory consumption and faster training, making it suitable for integration in larger learning architectures.

The GRU iteratively applies a function to the input sequence $\{S_{u}\}^{t-W}_{u=t}$. For the first layer of GRUs, at each time step $k\in \{0,W\}$ 
of the input sequence, for each column $Z_k \in \R^{b}$ of the matrix $\es$ and for each layer in the net, the GRU first updates the \textit{reset gate}: 
\begin{equation}
    p_k = \sigma(\textbf{H}_p Z_k + \textbf{U}_p h_{k-1} + \tilde b_p) 
\end{equation}

The \textit{update gate} is computed similarly:
\begin{equation}
    z_k = \sigma(\textbf{H}_z Z_k + \textbf{U}_z h_{k-1} + \tilde b_z) 
\end{equation}

Then, the \textit{candidate hidden} state is:
\begin{equation}
 \tilde{h}_k = \sigma(\textbf{H}_h Z_k + \textbf{U}_h  (p_k * h_{k-1}) + \tilde b_h)   
\end{equation}

And the \textit{final hidden} state update follows:
\begin{equation}
    h_k = (1 - z_k) * h_{k-1} + z_k * \tilde{h}_k
\end{equation}

Here $*$ denotes the element-wise product and we set $h_{-1}$ equal to the zero vector. The reset gate $p_k \in \R^{d_h}$ allows the GRU to discard or retain past information selectively, while the update gate $z_k\in \R^{d_h}$ controls how much of the past hidden state is carried forward. Denoting the dimension of the hidden layer with $d_h$, we
notice that $\textbf{U}_p, \textbf{U}_z, \textbf{U}_h \in \R^{d_h \times d_h}$, $\textbf{H}_p, \textbf{H}_z, \textbf{H}_h \in \R^{d_h \times b}$, $h_{k-1} \in \R^{d_h}$ is the hidden state from the previous time step, the bias vectors are $\tilde b_p $ and $\tilde b_h  \in \R^{d_h}$. Finally, $\sigma$ is the hyperbolic tangent (\verb!tanh!) activation function. 

The GRU units for subsequent layers take as input the sequence of hidden layers generated by the previous layer. In other words, the vector $Z_k$ in Eq. (6-8) is replaced by the vector $h_k$ of the previous layer. For this reason, for the layers different from the firs one we have $\textbf{H}_p, \textbf{H}_z, \textbf{H}_h \in \R^{d_h \times d_h}$.

From the GRU network we take as output the hidden state for $k=W$ of the last layer $\ell$. Therefore the dimension of the output is $o_t \in {\mathbb R}^{b}$ where we have added the subscript $t$ to indicate the time index of the operations performed by the Actor-Critic part of the algorithm.

The final matrix $\g_t \in {\mathbb R}^{(b \times 3)}$ —which is used as input to the Actor and Critic networks— contains the GRU output vector $o_t$ as well as the inventory and the current signal value from the matrix $\f$. Note that the GRU output is not used to predict the next signal value, but rather to encode the temporal dependence structure of the signal process.

Before updating the parameters of the Critic network Q and of the Actor network $\pi$, we first optimise those of the GRU. To do so, we produce an estimate $\tilde{S}_{t+1}$ of the next signal by passing the final GRU hidden states through a linear layer with a \verb!LeakyReLU! activation. The GRU parameters are trained by minimising the mean squared error between $S_{t+1}$ and $\tilde{S}_{t+1}$.
The GRU parameters are therefore updated at each iteration of the algorithm, similarly to the Q and $\pi$ networks, but the GRU training per iteration occurs before the training of the Actor and the Critic networks.


\paragraph{The Actor and Critic networks.}
The Critic and Actor neural networks are feed-forward nets with four and three input neurons, respectively, a number of $l_{\text{NN}}$ layers of $d_{\text{NN}}$ hidden nodes, each with \verb!SiLu! activation function, in the Actor network, the final layer has \verb!tanh! activation function, whose output is then scaled by $I_{\text{max}}$. 

As we are not assuming any initial or final inventory goals or penalties, in our DDPG implementation, while training, we choose not to keep memory of the states that the agent has visited during training. Rather, we feed randomly generated initial states of the world in order to let the algorithm explore as many states as possible, as discussed in Sec.~\ref{sec:actions_rewards}.  

This is done to provide the agent with as many different states as possible when training. Moreover, since we do not consider any form of permanent impact generated by the agent when trading, the buy and sell actions performed by the agent have no direct effect on the signal process, and therefore no memory needs to be kept.

At the beginning of the training loop we initialise the networks $\pi, Q$ with random weights $\mu_\pi, \mu_Q$. As training unfolds, $(\mu_\pi, \mu_Q) \to (\mu^*_\pi, \mu^*_Q)$, where $(\mu^*_\pi, \mu^*_Q)$ are the optimal weights that correspond to the optimal policy that maximises the the sum of discounted rewards. 
 
During training the $Q$ network, in order to avoid an overestimation of the $Q$-values for the considered state-action pairs, we use a $Q_{\text{tgt}}$ network that is initialised at the beginning of the training routine as a copy of the $Q$ network with weights $\mu_{Q_{\text{tgt}}} = \mu_{Q}$, thus employing double deep Q-learning for the Critic part of the algorithm, the weights of the $\mu_{Q_{\text{tgt}}}$ are then periodically set equal to $\mu_Q$. In order to do so, we have adopted the soft update technique as described in the original DDPG paper by \cite{lillicrap2015continuous}, with the soft update parameter set to $0.001$.

\paragraph{The Critic network.}

For each training iteration, we train a Critic network $Q$. To this end, we add an additive exploration zero mean noise to the output of the Actor network $\pi$ (whose training is described below), whose variance declines at each iteration\footnote{Specifically, at the learning loop start we set $a > 0$ and $\varepsilon_{\text{min}} < a$ 
Then, for each train iteration $m \in \{1,N\}$ we set $\varepsilon = \max(a/(a + m), \varepsilon_{\text{min}})$. In this way, the more we iterate in the learning routine the lower the $\varepsilon$ value. $\varepsilon$ is then used as an additive noise in the Actor-Critic architecture used in both the learning algorithms.}.
The additive noise, $\varepsilon$, helps the Actor neural network to explore the range of inventory holdings to be held depending on the state.
Thus, while training the $Q$ network, $I_{{t+1}} = \pi(\g_t|\mu_\pi) + \mathcal{N}(0, \varepsilon)$, where \(\pi(\g_t|\mu_\pi)\) is the output of the Actor network. Clearly, as the training unfolds and $\varepsilon$ becomes smaller, the exploration noise diminishes and the policy chosen by the network $\pi$ becomes deterministic. In this way, given the weights $\mu^*_\pi$, found at the end of the training, the Critic network directly maps a state into an action such that:
\begin{equation}
    I^{*}_{{t+1}} = \pi(\s_{t}|\mu^*_\pi)
\end{equation}
Once the new level of inventory is obtained, it is used to calculate the reward for each state in the batch as in Eq.~\eqref{eq:reward}.

To train the $Q$ network, we update the weights $\mu_Q$ such that $\mu_Q = \argmin_{\mu_Q} \L_1(\mu_Q; \mu_{Q_{\text{tgt}}})$, by taking a single gradient step on the loss 

\begin{align}
        \L_1 &= \frac{1}{b} \sum^b_{i=1} (Q(\g_t^{(i)}, I^{(i)}_{{t+1}}|\mu_Q) - y^{(i)}_t)^2\\
        y^{(i)}_t &= r^{(i)}_{t} + \gamma Q_{\text{tgt}}(\g'\,^{(i)}_{t+1}, \pi(\g'\,^{(i)}_{t+1}|\mu_\pi)|\mu_{Q_{\text{tgt}}})
\end{align}

where the superscript $i$ indicates the $i$-th row of the matrix $\g_t$ and $\g'_t \in \R^{b\times (W+2)}$ is the matrix of inputs \(\g'_{t+1} = (o_{t+1}, S_{t+1}, I_{t+1})\), where \(o_{t+1}\) is obtained by passing to the GRU network the series of $\{S_{u}\}^{t-W+1}_{u=t+1}$ 
of past values of the signal from time $t-W+1$ up to time $t+1$.
The weights of the Critic network $\mu_Q$ are then updated using gradient descent.

Within the training loop we iterate this training process for the Critic network a number $\ell$ of times in order to explore the space of actions given the states more thoroughly, in order to  obtain better estimates for the $Q$-values.

\paragraph{The Actor network.}
For each training iteration we train the Actor network $\pi$, which is the neural network responsible for choosing the action $I_{t+1}$. 
To do this, we feed the $\pi$ network with a batch of $b$ states $\g_t$.  The $\pi$ network returns a new level of inventory to be held $I_{t+1}$, which is in turn fed to the Critic $Q$ network, along with the state $\g_t$. The output of the $Q$ network is the $Q$ value which is maximized during training. Specifically, the weights $\mu_\pi$ of the Actor network are found by maximizing the output of the Critic network with fixed weights $\mu_Q$. As before we perform a single gradient step to minimise the loss:

\begin{equation}
    \L_2 = - \frac{1}{b} \sum^b_{i =1} Q(\g_t^{(i)}, \pi(\g_t^{(i)}|\mu_\pi)|\mu_Q)
\end{equation}
 where $\pi(\g_t^{(i)}|\mu_\pi)$ is the output of the Actor network with current weights $\mu_\pi$.
The weights $\mu_\pi$ are updated using the policy gradient theorem. The derivative of the loss function $\L_2$ with respect to the weights of the Actor network is:
\begin{equation}
    \nabla_{\mu_\pi}\L_2 = - \frac1b\sum^b_{i=1}\left[ \nabla_{a}Q(\s_t^{(i)}, a^{(i)}|\mu_Q)|_{a^{(i)} = \pi(\s_t^{(i)}|\mu_\pi)} \nabla_{\mu_\pi}(\s_t^{(i)}|\mu_\pi) \right]
\end{equation}
where the first part in the square brackets tells us how sensitive the $Q$ network is to changes in the action chosen by the Actor $\pi$, this is the gradient of the $Q$-value with respect to the action and evaluated at the action suggested by the Actor network, in this context for ease of notation we use $a^{(i)}=I^{(i)}_{{t}+1}$ to denote the action for the \(i\) state among the $b$ considered in the batch. The second part inside the brackets is the gradient of the the actor's policy and accounts for how much the action $I_{t+1}$ changes with respect to changes in the $\pi$ network parameters. We update the weights for the $\pi$ network with gradient descent. We repeat this training routine a number $l$ of times in order to assess how the quality of the actions chosen by the Actor changes and, in this way, to thoroughly explore weights combinations for the $\pi$ network. 

The complete training algorithm for both the Critic and the Actor neural networks is reported in Algorithm~\ref{algo:ddpg}. Both the Actor and the Critic neural networks are feed-forward fully connected neural networks, for the gradient descent we use the Weighted ADAM optimiser with a scheduler. The features for the DDPG algorithm are normalised in the domain $[0, 1]$. Relevant parameters for the networks and the market model are reported in Table~\ref{tab:sim_pmts}. We will refer to this model as \textit{hid-DDPG} throughout the paper.

\subsection{The two-step approach}
\label{sec:methodS_two_step}

To approximate the optimiser of  Problem~\eqref{eq:max_pb} when the trading signal follows the dynamics in Eq.~\eqref{eqn:OU-SDE} with regime switching parameters, we further propose a two-step procedure in two different setups. For the first setup, in the first step, we approximately solve the filtering problem, aiming at estimating the posterior probability of being in one of the regimes of $\theta_t$. In the second step, we approximate the optimal trading policies that use the estimated posterior distribution as an additional feature. 
These estimates, together with the signal $S_t$ and the inventory level $I_t$, constitute the features used in the RL algorithm. The directed graph representation of the training for this algorithm is reported in Figure~\ref{fig:two-step-architecture}. In the third setup we repeat the procedure but, instead of filtering the posterior probabilities for the $\theta_t$ regimes, we train a GRU to obtain estimates of the next value of the trading signal, i.e.  $\tilde S_{t+1}$, we will use this estimate along with the signal $S_t$ and the inventory level $I_t$ as features to the DDPG algorithm. 
The directed graph representation of the training for this algorithm is reported in Figure~\ref{fig:two-step-architecture2}. 
The DDPG step for both the two-step procedure remains the same, except for the set of features used, as discussed at the end of Sec.\ref{sec:actions_rewards}.

\subsubsection{First-step: regime filtering with classification}
\label{sec:regime_filter_method}

Concerning the first step, we approximately solve the filtering problem, aiming at estimating the posterior probability of being in one of the regimes for $\theta_t$. Further, we approximate the optimal trading policies using the estimated posterior distribution as an additional feature. 

\input{architectures/twostep}

In this setup, we provide a deep learning approach to estimate the probability that $\theta_t$ is in one of the regimes, conditional on the history of the path of the signal process $S$. That is, we aim to find an approximation
\begin{equation}
\label{eqn:approx_pbm}
    \Phi_{t,k} := \P(\theta_t=\phi_k| (S_u)_{u\le t}) \approx g_k\left( S_t, \dots , S_{t-W}\right)\,,\qquad k=1,2,3
\end{equation}
The vector valued function $g(\cdot)=(g_1(\cdot),g_2(\cdot),g_3(\cdot))$ is approximated as an Artificial Neural Network (ANN) with $W$ being the look-back window used. The input, $\{S_{u}\}^{t-W}_{u=t}$, to the ANN $g(\cdot)$ is a sequence of trading signals that goes from time-step $t$ backwards to time $t-W$.

Once again, as the signal $S_t$ is a time series, a natural choice is to employ RNNs in the approximation consistently with the one-step method outlined in Sec.~\ref{sec:methodS_one_step} --- specifically, we employ a GRU network as our function approximant $g(\cdot)$.
On top of the GRU architecture, we nest additional fully connected layers  to return the probability for the signal $S_t$ to be mean reverting to a specific regime $\theta_t \in\{\phi_1,\phi_2, \phi_3\} $.

More specifically, the last hidden state is passed to a second architecture equipped with additional fully connected layers. In each hidden layer of the fully connected neural net we apply the Sigmoid Linear Unit (\verb!SiLu!) activation function to add non-linearity. In the end, since this is a classification problem, we use the \verb|SoftMax| activation function to retrieve the probability $\P\left(\theta_{t}=\phi_j|\{S_{u}\}^{t-W}_{u=t}\right)$. The loss used to train the architecture is the categorical cross entropy. 

The parameters for the GRU and the additional layers are reported in Table~\ref{tab:sim_pmts}.

\subsubsection{First-step: regression setup}
\label{sec:regression setup}

As a point of comparison we develop a third setup to the two-step procedure. In this third experiment, instead of approximating the probability of being mean reverting at each of the regimes of $\theta_t$,  the first step consists in training a GRU net on a regression problem to directly estimating the next value for the trading signal, i.e. $\Tilde{S}_{t+1}$. 
Similarly as in the filtering problem, in order to obtain the next value estimate, we provide as input to the GRU $g(\cdot)$ a sequence $\{S_{u}\}^{t-W}_{u=t}$.
The architecture of the GRU net remains the same but the last layer has \verb!SiLu! activation function and we minimize the loss consisting of the squared error between the estimate $\Tilde{S}_{t+1}$ and the actual next value of the trading signal $S_{t+1}$. 

\input{architectures/twostep_reg}

\subsubsection{Second-step: optimal trading}

Once training in the first-step is completed, and the GRU models are trained for either of the setups in \ref{sec:regime_filter_method} or \ref{sec:regression setup}, we consider the problem of a risk neutral trader who maximises the expected discounted profits from trading. We assume that the agent re-balances the inventory according to the level of the observed trading signal and on their current inventory in order to maximise the rewards obtained from trading. 
To do so, we again model the agent with a DDPG algorithm similarly as in Sec.~\ref{sec:methodS_one_step}. Hence, for the optimal trading part of the algorithm we again adopt an Actor-Critic approach where we make use of two distinct neural networks, an Actor network $\pi$ that is responsible for choosing the action to perform, based on the state of the environment where the agent is, and a Critic network $Q$ that critically evaluates the `quality' of the action chosen using the network $\pi$ given the state of the environment. 
This is analogous to the one-step procedure with the important difference that, in the regime filtering approach, the posterior probabilities estimates on the current mean reversion regime $\theta_t$ are added to the feature set and the model that approximately solves the filtering model is trained in the previous step, while in the regression approach the estimate for the next value of the trading signal $S_t$ is added to the set of features fed to the RL agent. 

Hence, the first setup (and second method proposed) of the two-step approach is termed {\it prob-DDPG} and makes use of features $\s_{t} = (S_{t}, I_{t}, \Phi_{t, k})$ for the DDPG part, while the second setup (and third method overall) is termed {\it reg-DDPG} throughout the paper, and employs $\s_{t} = (S_{t}, I_{t}, \Tilde{S}_{{t+1}})$ as features to the DDPG. 

For the DDPG part we again set both Actor and Critic ANNs to be feed-forward fully connected neural networks as in the one-step approach. For the gradient descent steps we use the Weighted ADAM optimiser with a scheduler. The features of the DDPG algorithm are normalised in the domain $[0, 1]$. The relevant parameters for the networks and the market model are reported in Table~\ref{tab:sim_pmts}.
\section{Results}
\FloatBarrier
\begin{figure}[H]
\centering
\includegraphics[width=1\textwidth, angle = 0]{theta.png}
    \caption{Comparison of the cumulative rewards for the different DDPG approaches when $\theta_t$ is a Markov chain.}
    \label{fig:theta_rew}
\end{figure}
\FloatBarrier
We now test the capabilities of the approaches outlined above on synthetic data and for increasing levels of complexity for the data generating process as defined in Eq.~\eqref{eqn:OU-SDE}. To this end, as anticipated, we test our algorithm on environments where just $\theta_t$ is a Markov chain, where $\theta_t, \kappa_t$ are independent Markov chains, and finally, for the most complete case, where $\theta_t, \kappa_t$ and $\sigma_t$ are modelled via independent Markov chains. We employ both the two-step approaches and the one-step approach over a set of testing episodes, and then we subsequently compare the results, in terms of cumulative rewards, obtained by employing the trading strategies found by the DDPG agent.

In the testing phase, we compute the total reward for each of the $M$ testing episodes as $R_n = \sum^n_{t = 1} r_t$ where $n$ is the number of time steps in each iteration $M$ where the agent trades and $r_t$ is as defined in Eq.~\eqref{eq:reward}. For each experiment, we report the average and the standard deviation of the cumulative rewards over the $M$ test iterations. Clearly, the method that shows a higher average reward is the one that delivers the best optimal trading policy for the analysed problem. The simulation parameters for each experiment are reported in Table~\ref{tab:sim_pmts}. The transition rate matrices for the time varying parameters are $A_{\theta} = \begin{bmatrix}
  -0.1&  0.05&  0.05\\ 
  0.05& -0.1 &  0.05\\
  0.05&  0.05& -0.1\\
\end{bmatrix}$, $A_{\kappa} = \begin{bmatrix}
  -0.1& 0.1  \\
  0.1&  -0.1 \\
\end{bmatrix}$  and $A_{\sigma} = \begin{bmatrix}
  -0.1& 0.1  \\
  0.1&  -0.1 \\
\end{bmatrix}$.

\begin{table}[h]
    \centering
    \caption{Simulation parameters for the three experiments and the for the DDPG algorithm.} %
    \begin{tabular}{|c|c|c|c|c|c|}
             \hline
        \multicolumn{6}{|c|}{DDPG parameters}\\
        \hline
        lr$ = 0.001$ & $\mu_{\text{inv}} = 1$  & train eps. $N = 10,000$ & b $=512$&   $I_{\text{max}} = 10$ & $\lambda = 0.05$\\
        \hline
        l = $5$ &$\ell$ = $1$  & test eps. $M = 500$ & $I_{\text{min}} = -10$& $a = 100$& $\Delta t = 0.2,\, n=2,000$  \\
        \hline
        \multicolumn{2}{|c|}{hid-DDPG}&\multicolumn{2}{|c|}{prob-DDPG}&\multicolumn{2}{|c|}{reg-DDPG}\\
        \hline
        $l_{\text{NN}} = 4 $ & $d_{\text{NN}} = 20$ & $l_{\text{NN}} = 5 $ & $d_{\text{NN}} = 64$ & $l_{\text{NN}} = 5 $ & $d_{\text{NN}} = 64$\\
        \hline
    \hline
    \multicolumn{6}{|c|}{Simulation parameters}\\
    \hline
           MC pmt.                               & $\theta$           & $\kappa$   & $\sigma$&  layers & hidd. nod.\\
        \hline
         \hline
        $\theta_t$                     & $\{ 0.9, 1, 1.1\}$ & $5$        & $0.2$             &  $5$ & $16$ \\
         \hline
        $\theta_t, \kappa_t$            & $\{ 0.9, 1, 1.1\}$ & $\{3, 7\}$ & $0.2$            &  $5$ & $20$ \\
         \hline
        $\theta_t, \kappa_t, \sigma_t$  & $\{ 0.9, 1, 1.1\}$ & $\{3, 7\}$ & $\{0.1, 0.3\}$   &  $6$ & $20$ \\
         \hline 

    \end{tabular}
    \label{tab:sim_pmts}
\end{table}

\begin{table}[h]
  \centering
  \caption{Parameters used in the GRU algorithm for the two-step approaches.}
  \label{tab:pmts_gru}
  \begin{tabularx}{\textwidth}{|X X||X X|}
    \hline
    \multicolumn{4}{|l|}{\textbf{GRU parameters in the prob-DDPG and in the reg-DDPG two-step approach}} \\
    \hline
    NN layers & $d_l=5$ & $N$ train eps.  & $10,000$ \\
    \hline
    Hidden nodes & $d_h=20$ &  W-ADAM lr & $0.001$  \\
    \hline
    $W=10$ prob-DDPG &($W=50$ reg-DDPG)&  Predict window & $1$  \\
    \hline
    \multicolumn{4}{|l|}{\textbf{Linear layers parameters}} \\
    \hline
    NN layers & $5$ & Hidden nodes & $64$\\
    \hline
  \end{tabularx}
\end{table}

\begin{table}[h]
  \centering
  \caption{Parameters used in the GRU algorithm for the one-step approach.}
  \label{tab:pmts_gru_one_step}
  \begin{tabularx}{\textwidth}{|X X||X X|}
    \hline
    \multicolumn{4}{|l|}{\textbf{GRU parameters in the hid-DDPG one-step approach}} \\
    \hline
    NN layers & $d_l=1$ &  Hidden nodes & $d_h=10$ \\
    \hline
    Look-back window & $ W = 10$ &  W-ADAM lr & $0.001$  \\
    \hline
     \multicolumn{4}{|l|}{\textbf{GRU parameters in the hid-DDPG one-step approach ($\theta_t,\,\kappa_t,\,\sigma_t$ MCs)}} \\
    \hline
    NN layers & $d_l=2$ &  Hidden nodes & $d_h=10$ \\
    \hline
    Look-back window & $ W = 10$ &  W-ADAM lr & $0.001$  \\
    \hline
  \end{tabularx}
\end{table}

\begin{table}[h]
    \centering
    \caption{Average cumulative rewards and their standard deviation after $n = 2,000$ trades from the $M=500$ test episodes of trading for each approach used and for each data generating process employed. } 
    
    \begin{tabular}{|c|c|c|c|c|c|c|}
    \hline
         & \multicolumn{2}{|c|}{$\theta_t$ MC}& \multicolumn{2}{|c|}{$\theta_t,\,\, \kappa_t$ MCs} &\multicolumn{2}{|c|}{$\theta_t,\, \kappa_t,\,\sigma_t$ MCs} \\
         \hline
         Model rewards  &   Ave.    & Std.  & Ave.  & Std.  & Ave.  & Std.  \\
         \hline
         hid-DDPG       &   15.70   & 1.39  & 8.08  & 1.54  & 1.29  & 3.49   \\
         reg-DDPG       &   8.69    & 0.60  & 2.95  & 0.30  & -0.07 & 0.11   \\
         prob-DDPG      &   25.65   & 3.35  & 15.59 & 3.83  & 4.51  & 3.75   \\
         \hline
    \end{tabular}

    \label{tab:results_simulation}
\end{table}

\subsection{$\theta_t$ is a Markov chain}

In the first experiment we test the performance of our approaches in the case when only $\theta_t$ while $\kappa, \sigma$ are constant. In this case we allow the parameter of mean reversion to be $\theta_t \in \{ \phi_1 = 0.9, \phi_2 = 1, \phi_3 = 1.1\}$. The results of this, as well as of the other, settings are summarized in Table~\ref{tab:results_simulation} and in Figure~\ref{fig:theta_rew}. 

By considering first the one step \textit{hid-DDPG} approach, we notice that feeding the hidden states of a GRU network, trained along with the DDPG algorithm, provides the actor network with a policy capable of generating, on average, positive cumulative rewards. Therefore, GRU hidden states provide valuable information to the DDPG algorithm, helping the Actor network in finding policies which exploit the coded information of the parameter state. 

Considering the rewards obtained by the two step \textit{prob-DDPG} approach, which first learns to map signal to posterior probabilities and only afterwards learns the optimal trading, we notice that it generally outperforms the one-step approach in terms of cumulative rewards. This is not surprising, since the two-step approaches have the great advantage of separating the learning from the optimization phase, while in the one-step setting these tasks are performed contemporaneously. In practical setting, the two-step procedure  might not be feasible as many training episodes are necessary for this task.

However, the two-step approach does not always outperforms the one-step algorithm.
In fact, considering the two-step \textit{reg-DDPG} approach, where we first train a GRU network to predict the value of the signal $S$ at time $t+1$, we can notice that the average rewards although still positive, are significantly lower than those obtained with the one-step {\it hid-DDPG}. We postulate that this effect on rewards is due to the difficult task of predicting the exact next value for the signal without information about the regimes of mean reversion. 

We now investigate in more details the action chosen by the different approaches. The actions chosen by the Actor network are reported in the left column of Fig.~\ref{fig:hid_ddpg}, \ref{fig:reg_ddpg} and \ref{fig:prob_ddpg} {of the Appendix A}, for the three approaches used.

Considering the first column of Fig.~\ref{fig:hid_ddpg}—which corresponds to the \textit{hid-DDPG} approach under a Markovian evolution of $\theta_t$—the inventory rebalancing actions, $q_t = I_{t+1} - I_t$, appear highly clustered, indicating a strong preference for a limited set of trading decisions.

Some actions $q_t$ appear counter-intuitive with respect to the levels of the observed inventory and signal. For instance, the policy sometimes suggests selling when the signal $S_t$ is low and the inventory $I_t$ is positive. The opposite also occurs: buying when $S_t$ is high and $I_t$ is low. In both cases, some rebalancing decisions still manage to exploit signal values. However, interpreting the resulting trading strategy is difficult, as the GRU hidden states—used as input features—encode relevant information about the signal process, but in a form that is largely non-interpretable.

Focusing on the \textit{prob-DDPG} policy in the first column of Fig.~\ref{fig:prob_ddpg}, we observe that buy and sell actions are predominantly concentrated on the left and right sides of the heatmap, respectively. This points out to the fact that the agent is more likely to buy when the trading signal $S_t$ is low, and to sell when it is high. In the scatter plots on the last row, buy and sell decisions tend to overlap at similar levels of inventory $I_t$, suggesting a more nuanced policy that takes into account the underlying regimes. The intuition is that providing the posterior probabilities of the latent state $\theta_t$ allows the agent to better condition its actions on the most likely regime, the current signal $S_t$, and the inventory level $I_t$. This is illustrated in greater detail in the first row of Fig.~\ref{fig:scatters_thetas}, where actions are shown as a function of $S_t$ and $I_t$, conditional on the posterior distribution. The shades of yellow represent the probability that $S_t$ is mean-reverting to a specific long-run average, as estimated by the GRU network trained in the first step. The colour of the border of each point indicates whether the action $q_t$ corresponds to a buy or a sell, given the current inventory level $I_t$ and signal $S_t$.

Since the trading action depends heavily on the expected mean-reversion level of $S_t$, the posterior distribution vector $\Phi_t$ provides crucial information. For instance, looking at the state probability of $\theta_t$ in the figure we see how, even if the level of the signal is low, when the agent is long on the signal and the probability of mean reverting to $\theta_t = 0.9$ is high, the agent is going to mostly sell. Conversely, in the lower part of the plot, where the agent is likely short and the signal is expected to revert upwards, the policy favours buying.

Finally, the reg-DDPG policy (first column of Fig.~\ref{fig:reg_ddpg}) appears to be less clustered around very few values for $I_t$, the sell/buy actions seem more reasonable with respect to the various combinations of signal and inventory, meaning that when the signal shows low values and the inventory holdings are low as well, the policy found suggests to the Actor to buy taking advantage of the estimated next value of the signal with respect to the actual value of the inventory holdings, contrary to the hid-DDPG case. 

\subsection{$\theta_t,\,\, \kappa_t$ are Markov chains}
\FloatBarrier
\begin{figure}[H]
\centering
\includegraphics[width=1\textwidth, angle = 0]{theta_kappa.png}
    \caption{Comparison of the cumulative rewards for the different DDPG approaches when $\theta_t$ and $\kappa_t$ follow a  Markov chain.}
    \label{fig:kappa_rew}
\end{figure}
\FloatBarrier

We now consider the case where the speed of mean reversion, $\kappa_t$, in Eq.~\eqref{eqn:OU-SDE} is also modeled as a Markov chain, which is is independent of the Markov chain governing the dynamics of $\theta_t$. In this setting, employing the \textit{hid-DDPG} approach delivers rewards that are positively distributed across the test episodes, as reported in Fig.~\ref{fig:kappa_rew}. Table~\ref{tab:results_simulation} shows that the average reward now is lower than the one obtained with the dynamics where only $\theta_t$ follows a Markov chain. This is expected since now the parameter dynamics is more complicated. 
Considering the \textit{reg-DDPG} approach, it can still be noticed that the rewards, although positive, lie on average below those scored by the \textit{hid-DDPG} approach. This is again due to the more complex signal's dynamics that the agent is trading, and as before the difficulty of predicting the next trading signal value persists, and appears to be stronger in this case due to the non-constant nature of the $\kappa_t$ parameter. 
When the \textit{prob-DDPG} approach is used, the algorithm scores lower average rewards than in the previous case, that was less complex, but the average rewards are still higher than those obtained with the other two approaches, as it can be noticed in Figure~\ref{fig:kappa_rew}. 

Analysing the actions chosen by the Actor network per level of inventory $I_t$ and trading signal $S_t$ in the second column of Fig.~\ref{fig:hid_ddpg}, \ref{fig:reg_ddpg} and \ref{fig:prob_ddpg} for the three approaches used it can still be noticed how the policies do change with respect to the type of information provided to the DDPG part of the approaches. In fact, it is evident how, for the \textit{reg-DDPG} and for the \textit{hid-DDPG}, in Fig.~\ref{fig:reg_ddpg} and in Fig.~\ref{fig:hid_ddpg} respectively, the actions employed and the subsequent new levels of inventory seem to be clustered around some of the levels of inventory $I_t$, thus the inventory holdings do not span much over the allowed inventory domain, $[I_{\text{max}},\, I_{\text{min}}]$. We postulate that this partly leads to the lower rewards obtained, as it can be noticed in Fig.~\ref{fig:kappa_rew}. When looking at the policy chosen by the \textit{prob-DDPG} in Fig.~\ref{fig:prob_ddpg}, it can be seen how the inventory holdings are more sparse, meaning that providing information on the data generating process' mean reversion level under the form of posterior probabilities on the regimes is more beneficial. In this case we can associate an interpretation to the policy adopted by the RL agent. In fact, in the second row of Fig.~\ref{fig:scatters_thetas} it can be understood how the policy of buys and sells $q_t$ does change both with respect of of $S_t$ and $I_t$ and with respect of the probability of being mean reverting to either of the regimes, now with two different speeds of mean reversion $\kappa_t$. Clearly, in neither of the approaches we do provide information on the speed of mean reversion, but it seems to be more beneficial to provide circumstantial information on the $\theta_t$ values if $\kappa_t$ follows a Markov chain, rather than providing hidden states or estimates for the next value of the trading signal, from both a cumulative reward and an interpretability point of view.

\subsection{$\theta_t,\,\, \kappa_t$ and $\sigma_t$ are Markov chains}
\FloatBarrier
\begin{figure}[h]
\centering
\includegraphics[width=1\textwidth, angle = 0]{theta_kappa_sigma.png}
    \caption{Comparison of the cumulative rewards for the different DDPG approaches when $\theta_t$, $\kappa_t$, and $\sigma_t$ follow a Markov chain.}
    \label{fig:sigma_rew}
\end{figure}
\FloatBarrier
In the last and most complex experiment we allow also the volatility of the signal to transition between two regimes, a high and a low volatility regime, as reported in Table~\ref{tab:sim_pmts}. The Markov chain that models the transition between the two regimes is independent from those of the other parameters $\theta_t$ and $\kappa_t$. 

From the average cumulative rewards reported in Table~\ref{tab:results_simulation} we  see that, once again, the \textit{prob-DDPG} outperforms the other two approaches. 

Overall, we notice how average rewards of the \textit{reg-DDPG} approach are near zero, although slightly negative. We postulate that the inefficiency of a DDPG policy based off of information on the next signal level comes from the lower informative content that such an estimate can provide in a complex environment. The standard deviation for the rewards in this case is very low, but this depends on the policy adopted by the agent trained with such a two-step approach. Comparing both the results reported in Table~\ref{tab:results_simulation} and in Fig.~\ref{fig:sigma_rew} 
with the policy in Fig.~\ref{fig:reg_ddpg}, we see that actions $q_t$, compared with $I_{\text{max}}$, are small and that inventory levels $I_t$ change very little as the signal $S_t$ changes. This explains the small reward variability: the agent trades very cautiously, which reduces volatility in outcomes but also limits the overall rewards.

Moving to the \textit{hid-DDPG} approach, Table~\ref{tab:results_simulation} and Fig.~\ref{fig:sigma_rew}, we see that, that \textit{hid-DDPG} underperforms compared to the \textit{prob-DDPG}
while over performing with respect to the \textit{reg-DDPG} in terms of rewards. This is to be expected, as the environment has now become even more complex. The trading policy employed by the DDPG agent is still on average positive, meaning that the hidden states of the GRU network provided to the DDPG part of the approach are still informative, although less interpretable. As shown in Fig.~\ref{fig:hid_ddpg}, the actions chosen by the agent are of a higher magnitude if compared to those of the two other approaches, this translates into a
trading policy that still produces positive cumulative rewards on average, although lower than those obtained using the \textit{prob-DDPG}.

Turning to the \textit{prob-DDPG} approach\footnote{In this case we have set the look-back window to $W=20$.}, the average cumulative rewards form the trading policy are indeed lower in this more complex environment if compared with those obtained by the same approach in the other two simulative set-ups, however, they still remain higher than the other two approaches in this particular set-up, as reported in Table~\ref{tab:results_simulation}. Interestingly, the standard deviation does not change much over the course of the three different experiments for this approach.
Once again, we conclude that first learning the probability of the regime helps the DDPG algorithm choose policies with higher rewards. Due to the interpretability of this learnt feature, we can investigate how the \textit{prob-DDPG} approach takes advantage of the  $\theta_t$ regime knowledge and chooses buy/sell actions not just based on the current level of $S_t$ and $I_t$ but on the regime probabilities, as displayed in Fig.~\ref{fig:scatters_thetas} and in Fig.~\ref{fig:prob_ddpg}.

\section{Pair trading application}

Having seen how the three approaches behave with synthetic data, we now turn to testing them on real market data. We focus on the problem faced by an agent whose goal is to trade two co-integrated assets; the classical \textit{pair trading} framework. We thus train a RL agent, using real high-frequency mid-price data, to trade according to a co-integration signal. The signal is, roughly speaking, the process made by a portfolio of the two assets under consideration. The goal is to assess which method produces higher rewards when exposed to real market conditions. At the same time, it allows us to investigate how the balance between flexibility and the specificity of the information provided to the agent, affects the overall performance of the RL algorithms used.

For these experiments, we apply a methodology similar to the one in \cite{cartea2015algorithmic} to obtain the parameters for the model and \cite{chan2013algorithmic} to obtain the benchmark Z-score strategy.

\subsection{Dataset, preliminary data analysis and market model}

We consider two assets traded on the NASDAQ between the 29th of August 2025 and the 5th of September 2025, the Intel (INTC) stock and the Merril Lynch semi-conductors ETF (SMH) whose holdings are around 20\% composed by INTC shares. 

We use high frequency observations of the limit order book for both the assets, downloaded from the LOBSTER database, we consider data up to the first level of the order book and we select only trade events, so that each element considered in the time series represents a transaction. Then, calculate the mid-price and filter the mid-prices at a frequency of 1 second, such that we have a clean dataset that displays prices at even intervals of time. Both time series are displayed in Fig.~\ref{fig:SMHvsINTC}.

\begin{figure}[ht]
    \centering
    \includegraphics[width=\linewidth]{smh_vs_intc_midprice_by_day_collapsed.pdf}
    \caption{Mid-prices for SMH and INTC, prices are intended in US dollars.}
    \label{fig:SMHvsINTC}
\end{figure}

We test the two assets for co-integration using Johansen test statistics, the results are reported in Table~\ref{tab:johansen}. We see that both tests indicate strong evidence of at least one co-integrating vector. Meaning that there exists at least one stationary linear combination denoted with:
\begin{equation}
    \Tilde{S}_t = \alpha_1 S^{\text{smh}}_t + \alpha_2 S^{\text{intc}}_t
\end{equation}

\begin{table}[ht]
\centering

\caption{Johansen Co-integration Test (5\% level)}
\begin{tabular}{c ccc ccc}
\toprule
$r$ & Trace Stat & Crit & Reject & Max-Eig Stat & Crit & Reject \\
\midrule
0 & 27.456 & 18.399 & Yes & 19.222 & 17.148 & Yes \\
%1 &  8.234 &  3.842 & Yes &  8.234 &  3.842 & Yes \\
\bottomrule
\end{tabular}
\caption{Trace statistic, maximum Eigenvalue statistic and their critical values of the Johansen test for co-integration. The H0 is no co-integrating vector.}
\label{tab:johansen}
\end{table}

Notice that the process $\Tilde{S}_t$ is a linear combination of the assets prices. We assume that the dynamics for this portfolio can be modelled as:

\begin{equation}
\label{eq:price_tilde}
       d\Tilde{S}_t = \Tilde{\kappa} (\Tilde{\theta}- \Tilde{S}_t) \,\dt + \Tilde{\sigma} \, \dW_t,
\end{equation}
so that the linear combination of the two time series of mid-prices is stationary. We use as a portfolio $\Tilde{S}_t$ where the amount of assets held are fixed at $\alpha_1$, $\alpha_2$, given by the co-integrating coefficients. We adjust the level of stocks held in the co-integrating portfolio but keep the ratio fixed at a ratio of $\alpha_1$, $\alpha_2$. The book-value of the portfolio at every time-step $t$ is therefore
\begin{equation*}
    BV_t = I_t\left( \alpha_1 \,S^{\text{intc}}_t + \alpha_2\, S^{\text{smh}}_t \right)\,.
\end{equation*}

First, we retrieve the co-integrating coefficients. To this end, we fit a Vector AutoRegressive (VAR) model of the form
\begin{equation*}
    \Delta\textbf{S}_t = \Vec{A} + \mathbf{B}\Delta\textbf{S}_{t-1} + \Vec{\varepsilon}_t\,.
\end{equation*}
That is a discrete time version of the model in Eq.~\eqref{eqn:OU-SDE} where $\textbf{S}_t = \left[{S}_t^{\text{smh}} , S_t^{\text{intc}} \right]$ are the mid-prices of INTC and SMH, $\Vec{A}$ is a vector of constants, $\mathbf{B}$ is matrix of constants and $\Vec{\varepsilon}_t$ is a vector of white noise, $\Delta\textbf{S}_t$ denote the mid-prices change at each time-step. The estimated parameters are reported in Table~\ref{tab:var_model}.

\begin{table}[h]
\centering
\caption{VAR Model Coefficients at 1\% significance.}
\label{tab:var_model}
\begin{tabular}{|l|c|c|c|}
\hline
& \multicolumn{2}{c|}{\textbf{B}} & {A} \\

& $\Delta S_{t-1,\text{SMH}}$ & $\Delta S_{t-1,\text{INTC}}$ & \\
\hline
$\Delta S_{t,\text{SMH}}$ & 0.999$^{(***)}$ & 0.00001 & 0.021 \\
$\Delta S_{t,\text{INTC}}$ & 0.0007 & 0.996$^{(***)}$ & 0.003 \\
 \hline 
\end{tabular}
\end{table}

From these estimates, we may estimate the coefficients in Eq.~\eqref{eq:price_tilde}, and thus obtain the co-integrating coefficients for $\tilde{S}_t$, assuming $\Delta t = 1$.

\begin{equation}
    \begin{split}
        \kappa & = (\mathbb{I} - \mathbf{B})/ \Delta t = \begin{bmatrix}
             1.40\cdot 10^{-04} & -1.52\cdot 10^{-05} \\
             -7.78\cdot 10^{-04} & 3.05\cdot 10^{-04} \\
        \end{bmatrix},
        \\
       \Tilde{\theta} &= \kappa^{-1}\Vec{A}\Delta t = \begin{bmatrix}
             287.77 \\ 
             24.183 \\
        \end{bmatrix}
        ,\\
        \kappa &= U^{-1} \Lambda U \\
        \Lambda &= \begin{bmatrix}
             8.67\cdot 10^{-05} & 0 \\
             0 & 3.59 \cdot 10^{-4} \\
        \end{bmatrix}.
     \end{split}
\end{equation}
Having estimated the parameters that describe the dynamics outlined in Eq.~\eqref{eq:price_tilde} we now find two possible candidates for $\Tilde{S}$:
\begin{equation}
    \Tilde{S} =  U^{-1}\textbf{S} = \begin{bmatrix}
         -2.960 &  -0.205\\ 
         2.856 & -0.804\\
         \end{bmatrix} \textbf{S}\,.
\end{equation}
Where $\textbf{S}$ is as before.
The coefficients in the second row of $U^{-1}$ are the co-integrating coefficients that correspond to the highest eigenvalue in the matrix $\Lambda$. 
This means that a portfolio with these coefficients will be the most exposed to mean reversion. Thus, the portfolio we will focus on is
 \begin{equation}
     \label{eq:ptf}
    \Tilde{S}_t = 2.856 \times S^{\text{smh}}_t - 0.804 \times S^{\text{intc}}_t 
 \end{equation}
 and use $\Tilde{S}_t$ as the asset to be traded, keeping fixed the weights in Eq.~\eqref{eq:ptf}.
 
\begin{figure}[H]
    \centering
    \includegraphics[width=\linewidth]{S_tilde_regimes.pdf}
    \caption{Normalised time series for the training phase of the co-integrated portfolio $\Tilde{S}_t$ and the most probable regimes at each time step.}
    \label{fig:S_tilde_regimes}
\end{figure}
\begin{figure}[H]
    \centering
    \includegraphics[width=\linewidth]{S_tilde_test.pdf}
    \caption{Normalised time series for the testing phase of the co-integrated portfolio $\Tilde{S}_t$.}
    \label{fig:S_tilde_test}
\end{figure}


We divide the time series for $\tilde{S}_t$  into two sets: a training set  (Fig.~\ref{fig:S_tilde_regimes}) and a testing set (Fig.~\ref{fig:S_tilde_test}). The training set is composed by the observations up to the 4th of September and the testing set are the observations on the 5th of September. In this way, we train the agent on almost a week of data and then test the trading performance over one day, the 5th of September. We normalise the $\tilde{S_t}$ series using min-max normalization over the training set\footnote{The reason is twofold, on the one hand with normalised data Hamilton's procedure is more numerically stable, on the other hand we will feed the normalised series to the algorithms that require normalise data.} and we then estimate two possible regimes for $\tilde{S}_t$ over the training set, following the procedure outlined in \cite{hamilton1989}, Chapter 22. Following this procedure we find that the two regimes are $\theta_1 = 0.2216$ and $\theta_2=0.5658$.  Fig.~\ref{fig:S_tilde_regimes} reports the most probable regime at each time-step.

\subsection{Trading experiments}

Based on the results on synthetic data we now employ the approaches that performed the best in the case of $\theta_t,\,\kappa_t\,\,\sigma_t$ modelled as Markov chains, as that was the most complex environment. We thus tackle the pair trading problem with both the \textit{hid-DDPG} approach and the \textit{prob-DDPG} approach. The parameters used for the simulations are reported in Table~\ref{tab:real_pmts} for the DDPG part of the model, while for GRU part of the algorithm we keep the parameters as in the case for $\theta_t,\,\kappa_t\,\sigma_t$ modelled as Markov chains for both of the approaches. During training the $\{\tilde S_{u}\}^{t-W}_{u=t}$ fed to the GRU and both to Actor and the Critic networks are randomly picked from the training set and have, as in the simulated case above, length $W$.

\begin{table}[ht]
    \centering
    \begin{tabular}[\textwidth]{|c|c|c|}
        \hline
        \multicolumn{3}{|c|}{prob-DDPG parameters} \\
        \hline
        train eps. $10,000$ & lr $= 0.001$ & batch $= 64$ \\
        \hline
        $\gamma = 0.999$ & $I_{\text{max}} = 10$ & $\lambda = 0.05$ \\
        \hline
        $\theta = \{0.2216, 0.5658\}$ & $W = 100$ & layers $= 6$ \\
        \hline
        hidd. nod. $= 64$ & train obs. $= 72,700$ & test obs. $= 19,789$ \\
        \hline
    \end{tabular}
    \caption{Parameters for the prob-DDPG algorithm.}
    \label{tab:real_pmts}
\end{table}

The reward for the DDPG phase of the algorithm is the book-value of the portfolio with a transaction cost $\lambda$, thus similarly to the simulated experiments, the reward is
\begin{equation}
     r_t = \Delta BV_t - \lambda |I_{t} - I_{t-1}|
\end{equation}
where, as before, $I_{t}$ is the action decided by the DDPG Actor network. We use as benchmark the rolling Z-score trading strategy, which is a strategy where the agent accumulates units of $\Tilde{S}_t$ proportional to the negative rolling Z-Score of the portfolio itself. For the rolling Z-score computation we use the same window $W=100$ as in the GRU algorithm. Thus, we compare the \textit{prob-DDPG} and the \textit{hid-DDPG} and the rolling Z-score strategies as reported in Fig.~\ref{fig:returns_real} and in Fig.~\ref{fig:hist_rew_SMH_INTC}.

\begin{figure}[ht]
    \centering
    \includegraphics[width=\linewidth]{cumulative_rewards_comparison_final.pdf}
    \caption{Comparison of realised cumulative rewards for the \textit{hid-DDPG}, \textit{prob-DDPG} and rolling Z-score strategy on the testing set.}
    \label{fig:returns_real}
\end{figure}

\begin{figure}[t]
    \centering
    \includegraphics[width=\linewidth]{reward_distribution_comparison_subplots.pdf}
    \caption{Histograms of the realised cumulative rewards for the three methods used.}
    \label{fig:hist_rew_SMH_INTC}
\end{figure}

As in Fig.~\ref{fig:returns_real}, the \textit{prob-DDPG} strategy outperforms the others in the test set by achieving the highest average reward, ultimately resulting in the highest cumulative rewards through the selected policy in this straightforward trading experiment. Indeed, Fig.~\ref{fig:hist_rew_SMH_INTC} shows that while average cumulative rewards are positive with the \textit{prob}-DDPG approach, they are negative for the other methods. Although the cumulative rewards for the \textit{hid}-DDPG case are higher than those from the naive Z-score strategy, they remain below those of the \textit{prob}-DDPG method. The average rewards, along with their standard deviations, are detailed in Table~\ref{tab:smh_intc_rez}.

\begin{table}[h]
    \centering
    \caption{Average cumulative rewards and their standard deviation for the approaches used. Rewards are calculated over one day of trading at a frequency of 1 second.} 
    
    \begin{tabular}{|c|c|c|c|}
    \hline
         Cum. Rew.  &   prob-DDPG    & hid-DDPG  & Z-score \\
         \hline
         Average       & $0.1795$ & $-0.2883$ & $-0.8432$ \\
         Std. Dev.     & $0.1329$ & $0.1282$  & $0.4341$   \\
         \hline
    \end{tabular}
    \label{tab:smh_intc_rez}
\end{table}

These findings are consistent with the outcomes from the numerical experiments discussed earlier. Consequently, leveraging the probability of transitioning into either a lower or higher regime for the portfolio $\Tilde{S}_t$ significantly helps the RL algorithm in determining the most suitable trading policy, especially when dealing with a potentially intricate and unknown data-generating process. This two-step approach enhances the interpretability of these algorithms, which are typically known as \textit{black boxes} and often function as data-intensive oracles that can yield inefficient solutions, as observed with the \textit{hid}-DDPG algorithm applied to this issue, unless equipped with background information about the problem at hand. Therefore, we can conclude that the information provided to the agent, and especially the way in which the information is used, does matter when training a RL agent and is paramount for the effective and successful application of model-agnostic algorithms like RL architectures, even with high-frequency data with strong simplifying assumptions. 

\section{Conclusions}

In this paper, we have developed three different DDPG algorithms to approximately solve the optimal trading problem when the trading signal is mean-reverting, and the parameters of the data-generating process are modelled as independent Markov chains. Given the sequential nature of the trading signal, we have chosen to use Gated Recurrent Units (GRUs), a specific type of recurrent neural network, to effectively process the time-dependent structure of the signal data used by the agent to trade. The GRU structure and the output of these networks is then used in three different ways to train a RL agent, modelled using the DDPG framework.

The trading signal is modelled as an Ornstein-Uhlenbeck process, which, in the simplest case, reverts to three distinct long-run regimes. The transitions between these regimes are governed by a Markov chain. The agent approximately solves the trading problem by leveraging information about the state of the world, which encompasses the current value of the trading signal, the inventory level, and posterior probability estimates of the most likely regime. Alternatively, the agent may rely on an estimate of the next trading signal value -- computed in a previous step -- or directly use hidden states extracted from a GRU network trained in conjunction with the DDPG Actor-Critic networks, thus training the GRU network along with the RL algorithm.

We tested the agent's performance in increasingly more complex environments where, along with the mean reversion parameter, both the speed of mean reversion and the volatility of the trading signal were governed by independent Markov chains.

The numerical results show that the agent, when equipped with posterior probability estimates of the mean reversion regimes (which it learns in a first stage), achieves the highest trading rewards. This suggests that providing structured and interpretable information to a RL algorithm significantly enhances its ability to approximate solutions to inter-temporal optimisation problems.

Finally, we find that these conclusions remain valid when the agent faces trading problems with real market data, when dealing with a pair trading problem for two co-integrated assets.

We can conclude that when tackling optimisation problems which do not result in closed-form solutions, the quality of information provided to the RL algorithm is crucial for the quality of the solution. Although all three approaches result in a trading policy that, on average, yields either positive or, in the worst case, close to zero average rewards across all scenarios considered, the approach that consistently works best is to first gather insights into the dynamics of the data-generating process and only then incorporate this information into the features that the agent uses in the RL algorithm.

Interestingly, the type of information fed into the algorithm also appears to be a key factor. Specifically, providing estimates of the next signal values does not yield any significant improvement, suggesting that it is more effective to supply general information about the process -- as in the \textit{hid-DDPG} approach -- while ensuring that this information remains closely related to the actual parameters governing the underlying dynamics, as in the \textit{prob-DDPG} approach. Indeed, the latter proves to be the most effective, delivering the highest rewards when tested on both synthetic and real data.

Future research directions could be to investigate how, and by how much, the quality and the type of information affects the learning process, the resulting interactions, and the eventual equilibria that might emerge in a similar setup but in a multi-agent type of problem.

\printbibliography
\newpage
\begin{appendices}
\section{Figures}
\begin{figure}[ht]
    \centering
    \begin{subfigure}{\textwidth}
        \centering
        \includegraphics[scale=0.4]{new_figs/scatters_I_tVSq_t_hid.pdf}
        \caption{hid-DDPG}
        \label{fig:hid_ddpg}
    \end{subfigure}

    \begin{subfigure}{\textwidth}
        \centering
        \includegraphics[scale=0.4]{new_figs/scatters_I_tVSq_t_reg.pdf}
        \caption{reg-DDPG}
        \label{fig:reg_ddpg}
    \end{subfigure}

    \begin{subfigure}{\textwidth}
        \centering
        \includegraphics[scale=0.4]{new_figs/scatters_I_tVSq_t.pdf}
        \caption{prob-DDPG}
        \label{fig:prob_ddpg}
    \end{subfigure}

    \caption{Value of buy and sell actions $q_t$ per level of inventory $I$ and signal $S_t$ for the different approaches used.}
    \label{fig:actions_varie}
\end{figure}

\begin{figure}[H]
    \centering
    \includegraphics[width=1.5\textwidth, angle = 270 ]{figs_slides/scatters_thetas.pdf}
    \caption{Policies chosen by the DDPG agent per level of inventory, price signal $S_t$ and posterior probability of mean reversion $\theta_t$, when \textit{prob-DDPG} approach is used.}
    \label{fig:scatters_thetas}
\end{figure}

\newpage
\section{Algorithms}

\begin{algorithm}[h]
\caption{Deep Deterministic Policy Gradient (DDPG)}

\begin{algorithmic}[1]
\Require $W$ look-back window, $\ell$, $l$  and $N$ iteration
\State \textbf{Initialise} actor network $\pi(\mu_\pi)$ and critic network $Q(\mu_Q)$ with random weights $\mu_\pi$ and $\mu_Q$
\State \textbf{Initialise} target network and $Q_{\text{tgt}}(s,a|\mu_{Q_{\text{tgt}}})$ with weights $\mu_{Q_{\text{tgt}}} \leftarrow \mu_Q$

\For {m = 1 , \dots, N} 
  \State  \textbf{Obtain} batches of length $b$ of $S_{[0, W+2]}$ signal time series and random levels of Inventory $I$.
  \State \textbf{Initialise} $\varepsilon = 1$
  \Procedure{GRU}{} 
  \\
  \hspace{1cm} Train the GRU network if hid-DDPG;
  \EndProcedure
  \Procedure{Update Critic}{}
  \For { $\ell$}
    \State Receive initial observation batch $\f$
    \State Pass $(\{S_{u}\}^{t-W}_{u=t}$ to GRU pre-trained and obtain $\{\Phi_k\}, k=1,2,3)$ (if prob-DDPG);
    \State Pass $(\{S_{u}\}^{t-W}_{u=t}$ to GRU pre-trained and obtain $\tilde S_{t+1}$ (if reg-DDPG);
    \State Pass $(\{S_{u}\}^{t-W}_{u=t}$ to GRU to train if (hid-DDPG);
    \State obtain \(\s\);
    \State Select inventory $I = \pi(\s|\mu_\pi) + \mathcal{N}(0, \varepsilon)$ according to the current policy and noise;
      \State Execute action $I$ and observe reward $r$;  and next state $\s'$;
      \State Observe next states $\s'$;
    \State Set $y^{(i)} = r^{(i)} + \gamma Q_{\text{tgt}}(\s'^{(i)}, \pi(\s'^{(i)}|\mu_\pi)|\mu_{Q_{\text{tgt}}})$ ;

    \State $\mathcal{L}_1 = \frac{1}{b} \sum_{i}^{b} (Q(\s^{(i)}, I^{(i)}|\mu_Q) - y^{(i)})^2$;

    \State Set $\mu_Q = \mu_{Q_{\text{tgt}}}$;
    
    \EndFor
  \EndProcedure
  \Procedure{Update Actor}{}
  \For l 
    \State Receive initial observation batch $\f$;
    \State Pass $(\{S_{u}\}^{t-W}_{u=t}$ to GRU pre-trained and obtain $\{\Phi_k\}, k=1,2,3)$ (if prob-DDPG);
    \State Pass $(\{S_{u}\}^{t-W}_{u=t}$ to GRU pre-trained and obtain $\tilde S_{t+1}$ (if reg-DDPG);
    \State Pass $(\{S_{u}\}^{t-W}_{u=t}$ to GRU to train if (hid-DDPG); 
    \State Obtain \(\s\);
    \State Get $I = \pi(\s|\mu_\pi)$;
    \State Minimise $\L_2 = -\frac{1}{b} \sum^b_{i =1} (Q(\s^{(i)}, \pi(\s^{(i)}|\mu_\pi)|\mu_Q)$ through gradient descent over
    $$     \nabla_{\mu_\pi}\L_2 = \frac1b\sum^b_{i=1}\left[ \nabla_{a}Q(\s^{(i)}, a^{(i)}|\mu_Q)|_{a^{(i)} = \pi(\s^{(i)}|\mu_\pi)} \nabla_{\mu_\pi}(\s^{(i)}|\mu_\pi) \right] $$
  \EndFor
  \EndProcedure
  \State Decrease $\varepsilon$;
\EndFor
\end{algorithmic}
\label{algo:ddpg}
\end{algorithm}
\end{appendices}

\end{document}
\DeclareMathOperator*{\argmin}{arg\,min}
\newcommand{\E}{{\mathbb E}}
\newcommand{\F}{{\mathcal F}}
\renewcommand{\P}{{\mathbb P}}
\renewcommand{\L}{\mathcal L}
\newcommand{\R}{\mathbb R}
\newcommand{\f}{\mathbf F}
\newcommand{\s}{\mathbf G}
\newcommand{\es}{\mathbf Z}
\newcommand{\g}{\mathbf G}
\DeclareMathOperator*{\argmax}{arg\,max}

\newcommand{\T}{\mathcal{T}}
\newcommand{\tT}{t\ge0}
\newcommand{\mcA}{\mathcal{A}}

\newcommand{\diff}{\rm{d}}
\newcommand{\dW}{{\rm{d} W}}
\newcommand{\dS}{{\rm{d} S}}
\newcommand{\dt}{{\rm{d} t}}
\newcommand{\du}{{\rm{d} u}}


\tikzstyle{node}=[shape=circle,draw=blue,fill=blue!10]
\tikzstyle{a}=[shape=circle,draw=green,fill=green!10]
\tikzstyle{q}=[shape=circle,draw=purple,fill=purple!10]
\tikzstyle{pi}=[shape=circle,draw=purple,fill=purple!10]
\tikzstyle{p}=[shape=circle,draw=purple,fill=yellow!10]
\tikzstyle{hidden}=[shape=circle,draw=red,fill=yellow!30]
\tikzstyle{gru}=[shape=rectangle,draw=black!50,fill=lime!20]
\tikzstyle{ffn}=[shape=rectangle,draw=black!50,fill=lime!20]
\begin{figure}[H]
    \centering
    \begin{tikzpicture}[scale=0.6,every node/.style={transform shape},minimum width=1.0cm]
    
    \node[hidden] (h0) at (-2,0) {$0$};

    %%%%

    \node[node] (y1) at (0,-1.5) {$S_{t-W}$};
    \node[gru] (gru1) at (0,0) {$~GRU~$};
    \node[gru] (gru11) at (0,1.5) {$~GRU~$};
    \node[hidden] (h1) at (0,3) {$h_{0}$};
    
    \draw [->] (h0) to (gru1);
    \draw [->] (y1) to (gru1);
    \draw [->] (gru1) to (gru11);
    \draw [->] (gru11) to (h1);

    %%%%
    
    \node[node] (y2) at (2,-1.5) {$S_{t-W+1}$};
    \node[gru] (gru2) at (2,0) {$~GRU~$};
    \node[gru] (gru21) at (2,1.5) {$~GRU~$};
    \node[hidden] (h2) at (2,3) {$h_{1}$};

    \draw [->] (y2) to (gru2);
    \draw [->] (gru1) to (gru2);
    \draw [->] (gru2) to (gru21);
    \draw [->] (gru11) to (gru21);    
    \draw [->] (gru21) to (h2);

    %%%
    
    \node[node] (y3) at (4,-1.5) {$S_{t-W+2}$};
    \node[gru] (gru3) at (4,0) {$~GRU~$};
    \node[hidden] (h3) at (4,3) {$h_{2}$};
    \node[gru] (gru31) at (4,1.5) {$~GRU~$};    
    
    \draw [->] (y3) to (gru3);
    \draw [->] (gru2) to (gru3);
    \draw [->] (gru3) to (gru31);
    \draw [->] (gru21) to (gru31);    
    \draw [->] (gru31) to (h3);

    %%%

    \node[node] (y4) at (7,-1.5) {$S_{t}$};

    \node[gru] (gru4) at (7,0) {$~GRU~$};
    \node[gru] (gru41) at (7,1.5) {$~GRU~$};
    \node[hidden] (h4) at (7,3) {$h_W$};
    
    \draw [->,dashed] (gru3) to (gru4);
    \draw [->] (y4) to (gru4);
    \draw [->,dashed] (gru31) to (gru41);
    \draw [->] (gru4) to (gru41);
    \draw [->] (gru41) to (h4);


    %%%
    %\node[gru] (ell) at (2, 5) {~$\mathcal{L}_{GRU}$~}; 
    %\node[ffn] (fgru) at (7,5) {~Act. Lin. Lay.~};
    %\node[node] (y5) at (4, 5) {$\tilde{S}_{t+1}$};
    %\node[node] (y6) at (0, 5) {${S}_{t+1}$};
    %\draw[->] (y5) to (ell);
    %\draw[->] (y6) to (ell);
    %\draw[->] (fgru) to (y5);
    
    \node[ffn] (fq) at (13,4.5) {$~Q-FFN~$};
    \node[ffn] (fpi) at (10.5,1.5) {$~\pi-FFN~$};
    \draw [->] (h4) to [out=0, in=180] (fq);
    \draw [->] (h4) to [out=0, in=90] (fpi);
    %\draw [->] (h4) to (fgru);

    %%%
    %\draw [->] (y5) to (fpi);
    %\draw[->] (y5) to (fq);
    %\draw [->] (gru4) to (ell);
    %\draw [->] (gru41) to (ell);
    %\draw [<->, dashed] (ell) to (gru4);
    %\draw [<->, dashed] (ell) to (gru41);

    %%%

    \node[a] (a) at (12,3) {$~I_{t+1}~$};
    \node[q] (q) at (15,3) {$~Q~$};
    \node[node] (y6) at (10,-1.6) {$I_{t}$};
    \draw [->] (fq) to [out=0,in=90] (q);    
    \draw [->] (a) to [out=90,in=-135] (fq);
    \draw [->] (fpi) to [out=0,in=-90] (a);
    % \draw [->] (y6) [out=90,in=-140] to (fpi);
    % \draw [->] (y6) [out=-140,in=-140] to (fq);
    \draw [->] (y6)  to (fpi);
    \draw [->] (y6)  to [out=0, in=-90] (fq);    
    % \draw[->] (gru4) to (fpi);
    % \draw[->] (gru4) to (fq);

    %%%

    %\node[pi] (pi) at (12,1.5) {$~\pi~$};
    %\draw[->] (fpi) to (pi);
    %\draw[->] (y5) to [out=-90,in=-140] (fpi);
    %\draw[->] (y5) to [out=90,in=90] (fq);
    \draw[->] (y4) to [out=0,in=-135] (fpi);
    \draw[->] (y4) to [out=45,in=180] (fq);    
    
    \end{tikzpicture}
    \caption{Directed graph representation of the neural network architecture for the one-step architecture. In the figure $d_\ell=2$. }
    \label{fig:one-step-architecture}%{\bf Io ci riprovo: i pallini blu in basso con $S$ sono $W+1$, mentre quelli in giallo sopra con gli $h$ sono $W$. Non puo' essere.}
\end{figure}
\begin{figure}[H]
    \centering
    \begin{tikzpicture}[scale=0.6,every node/.style={transform shape},minimum width=1.0cm]
    
    \node[hidden] (h0) at (-2,0) {$0$};

    %%%%

    \node[node] (y1) at (0,-1.5) {$S_{t-W}$};
    \node[gru] (gru1) at (0,0) {$~GRU~$};
    \node[gru] (gru11) at (0,1.5) {$~GRU~$};
    \node[hidden] (h1) at (0,3) {$h_{1}$};
    
    \draw [->] (h0) to (gru1);
    \draw [->] (y1) to (gru1);
    \draw [->] (gru1) to (gru11);
    \draw [->] (gru11) to (h1);

    %%%%
    
    \node[node] (y2) at (2,-1.5) {$S_{t-W+1}$};
    \node[gru] (gru2) at (2,0) {$~GRU~$};
    \node[gru] (gru21) at (2,1.5) {$~GRU~$};
    \node[hidden] (h2) at (2,3) {$h_{2}$};

    \draw [->] (y2) to (gru2);
    \draw [->] (gru1) to (gru2);
    \draw [->] (gru2) to (gru21);
    \draw [->] (gru11) to (gru21);    
    \draw [->] (gru21) to (h2);

    %%%
    
    \node[node] (y3) at (4,-1.5) {$S_{t-W+2}$};
    \node[gru] (gru3) at (4,0) {$~GRU~$};
    \node[hidden] (h3) at (4,3) {$h_{3}$};
    \node[gru] (gru31) at (4,1.5) {$~GRU~$};    
    
    \draw [->] (y3) to (gru3);
    \draw [->] (gru2) to (gru3);
    \draw [->] (gru3) to (gru31);
    \draw [->] (gru21) to (gru31);    
    \draw [->] (gru31) to (h3);

    %%%

    \node[node] (y4) at (7,-1.5) {$S_{t}$};
    \node[node] (y5) at (7,-3) {$I_{t}$};
    \node[gru] (gru4) at (7,0) {$~GRU~$};
    \node[gru] (gru41) at (7,1.5) {$~GRU~$};
    \node[hidden] (h4) at (7,3) {$h_W$};
    
    \draw [->,dashed] (gru3) to (gru4);
    \draw [->] (y4) to (gru4);
    \draw [->,dashed] (gru31) to (gru41);
    \draw [->] (gru4) to (gru41);
    \draw [->] (gru41) to (h4);

    %%%
    
    \node[ffn] (f) at (12,3) {$~g-FFN~$};
    \node[p] (p1) at (10,1.5) {$~p_1~$};
    \node[p] (p2) at (12,1.5) {$~p_2~$};
    \node[p] (p3) at (14,1.5) {$~p_3~$};
    
    \draw [->] (h4) to (f);
    \draw [->] (f) to (p1);
    \draw [->] (f) to (p2);
    \draw [->] (f) to (p3);
    
    %%%
    \node[q] (q) at (12,-1) {$~Q~$};
    \node[a] (a) at (14,-3) {$~I_{t+1}~$};
    %\node[pi] (pi) at (15,-1) {$~\pi~$};
    \node[ffn] (fq) at (10,0) {$~Q-FFN~$};
    \node[ffn] (fpi) at (14,0) {$~\pi-FFN~$};

    

    \draw[->] (p1) to  (fq);
    \draw[->] (p2) to [out=225,in=45] (fq);
    \draw[->] (p3) to [out=225,in=0] (fq);
    \draw[->] (a) to [out=180,in=-90] (fq);
    \draw[->] (y4) to [out=0,in=180] (fq);
    \draw[->] (fq) to (q);

    \draw[->] (p1) to [out=-45,in=180] (fpi);
    \draw[->] (p2) to [out=-45,in=135] (fpi);
    \draw[->] (p3) to (fpi); 
    \draw[->] (y4) to [out=-45,in=-90] (fpi);
    \draw[->] (y5) [out=0,in=-125] to (fpi); 
    \draw[->] (y5) to [out=45, in=-120] (fq);

    \draw[->]  (fpi) to [out=-45,in=90] (a); 

    \end{tikzpicture}
    \caption{Directed graph representation of the neural network architecture for the two-step architecture with regime filtering.}
    \label{fig:two-step-architecture}
\end{figure}
\begin{figure}[H]
    \centering
    \begin{tikzpicture}[scale=0.6,every node/.style={transform shape},minimum width=1.0cm]
    
    \node[hidden] (h0) at (-2,0) {$0$};

    %%%%

    \node[node] (y1) at (0,-1.5) {$S_{t-W}$};
    \node[gru] (gru1) at (0,0) {$~GRU~$};
    \node[gru] (gru11) at (0,1.5) {$~GRU~$};
    \node[hidden] (h1) at (0,3) {$h_{1}$};
    
    \draw [->] (h0) to (gru1);
    \draw [->] (y1) to (gru1);
    \draw [->] (gru1) to (gru11);
    \draw [->] (gru11) to (h1);

    %%%%
    
    \node[node] (y2) at (2,-1.5) {$S_{t-W+1}$};
    \node[gru] (gru2) at (2,0) {$~GRU~$};
    \node[gru] (gru21) at (2,1.5) {$~GRU~$};
    \node[hidden] (h2) at (2,3) {$h_{2}$};

    \draw [->] (y2) to (gru2);
    \draw [->] (gru1) to (gru2);
    \draw [->] (gru2) to (gru21);
    \draw [->] (gru11) to (gru21);    
    \draw [->] (gru21) to (h2);

    %%%
    
    \node[node] (y3) at (4,-1.5) {$S_{t-W+2}$};
    \node[gru] (gru3) at (4,0) {$~GRU~$};
    \node[hidden] (h3) at (4,3) {$h_{3}$};
    \node[gru] (gru31) at (4,1.5) {$~GRU~$};    
    
    \draw [->] (y3) to (gru3);
    \draw [->] (gru2) to (gru3);
    \draw [->] (gru3) to (gru31);
    \draw [->] (gru21) to (gru31);    
    \draw [->] (gru31) to (h3);

    %%%

    \node[node] (y4) at (7,-1.5) {$S_{t}$};
    \node[node] (y5) at (7,-3) {$I_{t}$};
    \node[gru] (gru4) at (7,0) {$~GRU~$};
    \node[gru] (gru41) at (7,1.5) {$~GRU~$};
    \node[hidden] (h4) at (7,3) {$h_W$};
    
    \draw [->,dashed] (gru3) to (gru4);
    \draw [->] (y4) to (gru4);
    \draw [->,dashed] (gru31) to (gru41);
    \draw [->] (gru4) to (gru41);
    \draw [->] (gru41) to (h4);

    %%%
    
    \node[ffn] (f) at (12,3) {$~\tilde{S}_{t+1}~$};
        
    \draw [->] (h4) to (f);
    
    
    %%%
    \node[q] (q) at (12,-1) {$~Q~$};
    \node[a] (a) at (14,-3) {$~I_{t+1}~$};
    %\node[pi] (pi) at (15,-1) {$~\pi~$};
    \node[ffn] (fq) at (10,0) {$~Q-FFN~$};
    \node[ffn] (fpi) at (14,0) {$~\pi-FFN~$};

    

    \draw[->] (f) to  [out=-135,in=90] (fq);
    \draw[->] (a) to [out=180,in=-90] (fq);
    \draw[->] (y4) to [out=0,in=180] (fq);
    \draw[->] (fq) to (q);

    \draw[->] (f) to [out=-45,in=90] (fpi);
    \draw[->] (y4) to [out=-45,in=-90] (fpi);
    \draw[->] (y5) [out=0,in=-125] to (fpi); 
    \draw[->] (y5) to [out=45, in=-120] (fq);

    \draw[->]  (fpi) to [out=-45,in=90] (a); 

    \end{tikzpicture}
    \caption{Directed graph representation of the neural network architecture for the two-step architecture with price prediction.}
    \label{fig:two-step-architecture2}
\end{figure}
% $ biblatex auxiliary file $
% $ biblatex bbl format version 3.3 $
% Do not modify the above lines!
%
% This is an auxiliary file used by the 'biblatex' package.
% This file may safely be deleted. It will be recreated by
% biber as required.
%
\begingroup
\makeatletter
\@ifundefined{ver@biblatex.sty}
  {\@latex@error
     {Missing 'biblatex' package}
     {The bibliography requires the 'biblatex' package.}
      \aftergroup\endinput}
  {}
\endgroup


\refsection{0}
  \datalist[entry]{nyt/global//global/global/global}
    \entry{briola2023deep}{misc}{}{}
      \name{author}{5}{}{%
        {{un=0,uniquepart=base,hash=b214151c52f8d52806090d24bf8f8fa0}{%
           family={Briola},
           familyi={B\bibinitperiod},
           given={Antonio},
           giveni={A\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=5784ba012fdeea2962dd0b3dd117e0c3}{%
           family={Turiel},
           familyi={T\bibinitperiod},
           given={Jeremy},
           giveni={J\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=b9155174e987a21a37eede51bd6acb3f}{%
           family={Marcaccioli},
           familyi={M\bibinitperiod},
           given={Riccardo},
           giveni={R\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=a143c6a9f7dd777232ed779c4382a0e9}{%
           family={Cauderan},
           familyi={C\bibinitperiod},
           given={Alvaro},
           giveni={A\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=93b54beeb14b61c7fca6c36f5c8c76d2}{%
           family={Aste},
           familyi={A\bibinitperiod},
           given={Tomaso},
           giveni={T\bibinitperiod},
           givenun=0}}%
      }
      \strng{namehash}{be686eb1a37cab59eb272ff89a7ac43f}
      \strng{fullhash}{c8452f670d52deb3ab33f2a478d7e346}
      \strng{fullhashraw}{c8452f670d52deb3ab33f2a478d7e346}
      \strng{bibnamehash}{be686eb1a37cab59eb272ff89a7ac43f}
      \strng{authorbibnamehash}{be686eb1a37cab59eb272ff89a7ac43f}
      \strng{authornamehash}{be686eb1a37cab59eb272ff89a7ac43f}
      \strng{authorfullhash}{c8452f670d52deb3ab33f2a478d7e346}
      \strng{authorfullhashraw}{c8452f670d52deb3ab33f2a478d7e346}
      \field{sortinit}{B}
      \field{sortinithash}{d7095fff47cda75ca2589920aae98399}
      \field{extradatescope}{labelyear}
      \field{labeldatesource}{}
      \field{labelnamesource}{author}
      \field{labeltitlesource}{title}
      \field{eprintclass}{cs.LG}
      \field{eprinttype}{arXiv}
      \field{title}{Deep Reinforcement Learning for Active High Frequency Trading}
      \field{year}{2023}
      \verb{eprint}
      \verb 2101.07107
      \endverb
    \endentry
    \entry{cartea2016incorporating}{article}{}{}
      \name{author}{2}{}{%
        {{un=0,uniquepart=base,hash=f44cd81b9149e6772753cb2ba9f054ec}{%
           family={Cartea},
           familyi={C\bibinitperiod},
           given={Álvaro},
           giveni={Á\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=aa8922fa8465c0b8208b33e873a556af}{%
           family={Jaimungal},
           familyi={J\bibinitperiod},
           given={Sebastian},
           giveni={S\bibinitperiod},
           givenun=0}}%
      }
      \list{publisher}{1}{%
        {Springer}%
      }
      \strng{namehash}{e0dbd44b827c96915f2487aecc0b8366}
      \strng{fullhash}{e0dbd44b827c96915f2487aecc0b8366}
      \strng{fullhashraw}{e0dbd44b827c96915f2487aecc0b8366}
      \strng{bibnamehash}{e0dbd44b827c96915f2487aecc0b8366}
      \strng{authorbibnamehash}{e0dbd44b827c96915f2487aecc0b8366}
      \strng{authornamehash}{e0dbd44b827c96915f2487aecc0b8366}
      \strng{authorfullhash}{e0dbd44b827c96915f2487aecc0b8366}
      \strng{authorfullhashraw}{e0dbd44b827c96915f2487aecc0b8366}
      \field{sortinit}{C}
      \field{sortinithash}{4d103a86280481745c9c897c925753c0}
      \field{extradatescope}{labelyear}
      \field{labeldatesource}{}
      \field{labelnamesource}{author}
      \field{labeltitlesource}{title}
      \field{journaltitle}{Mathematics and Financial Economics}
      \field{title}{Incorporating order-flow into optimal execution}
      \field{volume}{10}
      \field{year}{2016}
      \field{pages}{339\bibrangedash 364}
      \range{pages}{26}
    \endentry
    \entry{cartea2015algorithmic}{book}{}{}
      \name{author}{3}{}{%
        {{un=0,uniquepart=base,hash=f44cd81b9149e6772753cb2ba9f054ec}{%
           family={Cartea},
           familyi={C\bibinitperiod},
           given={Álvaro},
           giveni={Á\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=aa8922fa8465c0b8208b33e873a556af}{%
           family={Jaimungal},
           familyi={J\bibinitperiod},
           given={Sebastian},
           giveni={S\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=f89e7355a9f1fc8ddb1951360652cf32}{%
           family={Penalva},
           familyi={P\bibinitperiod},
           given={José},
           giveni={J\bibinitperiod},
           givenun=0}}%
      }
      \list{publisher}{1}{%
        {Cambridge University Press}%
      }
      \strng{namehash}{47d5913cfd00e9678d1c013a12c8366f}
      \strng{fullhash}{47d5913cfd00e9678d1c013a12c8366f}
      \strng{fullhashraw}{47d5913cfd00e9678d1c013a12c8366f}
      \strng{bibnamehash}{47d5913cfd00e9678d1c013a12c8366f}
      \strng{authorbibnamehash}{47d5913cfd00e9678d1c013a12c8366f}
      \strng{authornamehash}{47d5913cfd00e9678d1c013a12c8366f}
      \strng{authorfullhash}{47d5913cfd00e9678d1c013a12c8366f}
      \strng{authorfullhashraw}{47d5913cfd00e9678d1c013a12c8366f}
      \field{sortinit}{C}
      \field{sortinithash}{4d103a86280481745c9c897c925753c0}
      \field{extradatescope}{labelyear}
      \field{labeldatesource}{}
      \field{labelnamesource}{author}
      \field{labeltitlesource}{title}
      \field{title}{Algorithmic and high-frequency trading}
      \field{year}{2015}
    \endentry
    \entry{cartea2023reinforcement}{article}{}{}
      \name{author}{3}{}{%
        {{un=0,uniquepart=base,hash=f44cd81b9149e6772753cb2ba9f054ec}{%
           family={Cartea},
           familyi={C\bibinitperiod},
           given={Álvaro},
           giveni={Á\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=aa8922fa8465c0b8208b33e873a556af}{%
           family={Jaimungal},
           familyi={J\bibinitperiod},
           given={Sebastian},
           giveni={S\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=2fba460719a3bc225fba8e6ddf36472b}{%
           family={Sánchez-Betancourt},
           familyi={S\bibinithyphendelim B\bibinitperiod},
           given={Leandro},
           giveni={L\bibinitperiod},
           givenun=0}}%
      }
      \strng{namehash}{b5f748dde549a7f29b40d9f080952e2d}
      \strng{fullhash}{b5f748dde549a7f29b40d9f080952e2d}
      \strng{fullhashraw}{b5f748dde549a7f29b40d9f080952e2d}
      \strng{bibnamehash}{b5f748dde549a7f29b40d9f080952e2d}
      \strng{authorbibnamehash}{b5f748dde549a7f29b40d9f080952e2d}
      \strng{authornamehash}{b5f748dde549a7f29b40d9f080952e2d}
      \strng{authorfullhash}{b5f748dde549a7f29b40d9f080952e2d}
      \strng{authorfullhashraw}{b5f748dde549a7f29b40d9f080952e2d}
      \field{sortinit}{C}
      \field{sortinithash}{4d103a86280481745c9c897c925753c0}
      \field{extradatescope}{labelyear}
      \field{labeldatesource}{}
      \field{labelnamesource}{author}
      \field{labeltitlesource}{title}
      \field{journaltitle}{Machine Learning and Data Sciences for Financial Markets: A Guide to Contemporary Practices. Cambridge University Press}
      \field{title}{Reinforcement learning for algorithmic trading}
      \field{year}{2023}
    \endentry
    \entry{casgrain2019trading}{article}{}{}
      \name{author}{2}{}{%
        {{un=0,uniquepart=base,hash=4e7a31bdf1c125aa9e76a904505b16a8}{%
           family={Casgrain},
           familyi={C\bibinitperiod},
           given={Philippe},
           giveni={P\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=aa8922fa8465c0b8208b33e873a556af}{%
           family={Jaimungal},
           familyi={J\bibinitperiod},
           given={Sebastian},
           giveni={S\bibinitperiod},
           givenun=0}}%
      }
      \list{publisher}{1}{%
        {Wiley Online Library}%
      }
      \strng{namehash}{16f4845e97ec5d8085e21eafe063ebde}
      \strng{fullhash}{16f4845e97ec5d8085e21eafe063ebde}
      \strng{fullhashraw}{16f4845e97ec5d8085e21eafe063ebde}
      \strng{bibnamehash}{16f4845e97ec5d8085e21eafe063ebde}
      \strng{authorbibnamehash}{16f4845e97ec5d8085e21eafe063ebde}
      \strng{authornamehash}{16f4845e97ec5d8085e21eafe063ebde}
      \strng{authorfullhash}{16f4845e97ec5d8085e21eafe063ebde}
      \strng{authorfullhashraw}{16f4845e97ec5d8085e21eafe063ebde}
      \field{sortinit}{C}
      \field{sortinithash}{4d103a86280481745c9c897c925753c0}
      \field{extradatescope}{labelyear}
      \field{labeldatesource}{}
      \field{labelnamesource}{author}
      \field{labeltitlesource}{title}
      \field{journaltitle}{Mathematical Finance}
      \field{number}{3}
      \field{title}{Trading algorithms with learning in latent alpha models}
      \field{volume}{29}
      \field{year}{2019}
      \field{pages}{735\bibrangedash 772}
      \range{pages}{38}
    \endentry
    \entry{casgrain2022deep}{article}{}{}
      \name{author}{3}{}{%
        {{un=0,uniquepart=base,hash=4e7a31bdf1c125aa9e76a904505b16a8}{%
           family={Casgrain},
           familyi={C\bibinitperiod},
           given={Philippe},
           giveni={P\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=985a764bdfbcff697e0640fb754abc6c}{%
           family={Ning},
           familyi={N\bibinitperiod},
           given={Brian},
           giveni={B\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=aa8922fa8465c0b8208b33e873a556af}{%
           family={Jaimungal},
           familyi={J\bibinitperiod},
           given={Sebastian},
           giveni={S\bibinitperiod},
           givenun=0}}%
      }
      \list{publisher}{1}{%
        {Taylor \& Francis}%
      }
      \strng{namehash}{907238c72da01c44fe0bcc49fb21b70c}
      \strng{fullhash}{907238c72da01c44fe0bcc49fb21b70c}
      \strng{fullhashraw}{907238c72da01c44fe0bcc49fb21b70c}
      \strng{bibnamehash}{907238c72da01c44fe0bcc49fb21b70c}
      \strng{authorbibnamehash}{907238c72da01c44fe0bcc49fb21b70c}
      \strng{authornamehash}{907238c72da01c44fe0bcc49fb21b70c}
      \strng{authorfullhash}{907238c72da01c44fe0bcc49fb21b70c}
      \strng{authorfullhashraw}{907238c72da01c44fe0bcc49fb21b70c}
      \field{sortinit}{C}
      \field{sortinithash}{4d103a86280481745c9c897c925753c0}
      \field{extradatescope}{labelyear}
      \field{labeldatesource}{}
      \field{labelnamesource}{author}
      \field{labeltitlesource}{title}
      \field{journaltitle}{Applied Mathematical Finance}
      \field{number}{1}
      \field{title}{Deep Q-learning for Nash equilibria: Nash-DQN}
      \field{volume}{29}
      \field{year}{2022}
      \field{pages}{62\bibrangedash 78}
      \range{pages}{17}
    \endentry
    \entry{chan2013algorithmic}{book}{}{}
      \name{author}{1}{}{%
        {{un=0,uniquepart=base,hash=e8ec946789becc85ebf75f499474491b}{%
           family={Chan},
           familyi={C\bibinitperiod},
           given={Ernie},
           giveni={E\bibinitperiod},
           givenun=0}}%
      }
      \list{publisher}{1}{%
        {John Wiley \& Sons}%
      }
      \strng{namehash}{e8ec946789becc85ebf75f499474491b}
      \strng{fullhash}{e8ec946789becc85ebf75f499474491b}
      \strng{fullhashraw}{e8ec946789becc85ebf75f499474491b}
      \strng{bibnamehash}{e8ec946789becc85ebf75f499474491b}
      \strng{authorbibnamehash}{e8ec946789becc85ebf75f499474491b}
      \strng{authornamehash}{e8ec946789becc85ebf75f499474491b}
      \strng{authorfullhash}{e8ec946789becc85ebf75f499474491b}
      \strng{authorfullhashraw}{e8ec946789becc85ebf75f499474491b}
      \field{sortinit}{C}
      \field{sortinithash}{4d103a86280481745c9c897c925753c0}
      \field{extradatescope}{labelyear}
      \field{labeldatesource}{}
      \field{labelnamesource}{author}
      \field{labeltitlesource}{title}
      \field{title}{Algorithmic trading: winning strategies and their rationale}
      \field{year}{2013}
    \endentry
    \entry{cho2014learning}{article}{}{}
      \name{author}{7}{}{%
        {{un=0,uniquepart=base,hash=3da7501a79d9346572c7fd6e41b615df}{%
           family={Cho},
           familyi={C\bibinitperiod},
           given={Kyunghyun},
           giveni={K\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=2835acd2493c54182c074a35cd04ad4d}{%
           family={Van\bibnamedelima Merriënboer},
           familyi={V\bibinitperiod\bibinitdelim M\bibinitperiod},
           given={Bart},
           giveni={B\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=2adc0c92c308f233c731321d55efe58f}{%
           family={Gulcehre},
           familyi={G\bibinitperiod},
           given={Caglar},
           giveni={C\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=6d80adec79a13a33e73215c5f46f1605}{%
           family={Bahdanau},
           familyi={B\bibinitperiod},
           given={Dzmitry},
           giveni={D\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=6deedc795e51da1bc7fd6289ab321a48}{%
           family={Bougares},
           familyi={B\bibinitperiod},
           given={Fethi},
           giveni={F\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=449689e8c1ced50f608244e3a96fe6d3}{%
           family={Schwenk},
           familyi={S\bibinitperiod},
           given={Holger},
           giveni={H\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=40a8e4774982146adc2688546f54efb2}{%
           family={Bengio},
           familyi={B\bibinitperiod},
           given={Yoshua},
           giveni={Y\bibinitperiod},
           givenun=0}}%
      }
      \strng{namehash}{9b1920db887fe0d658725c1e606b61f4}
      \strng{fullhash}{f15ca920f15dc82592d8124096139969}
      \strng{fullhashraw}{f15ca920f15dc82592d8124096139969}
      \strng{bibnamehash}{9b1920db887fe0d658725c1e606b61f4}
      \strng{authorbibnamehash}{9b1920db887fe0d658725c1e606b61f4}
      \strng{authornamehash}{9b1920db887fe0d658725c1e606b61f4}
      \strng{authorfullhash}{f15ca920f15dc82592d8124096139969}
      \strng{authorfullhashraw}{f15ca920f15dc82592d8124096139969}
      \field{sortinit}{C}
      \field{sortinithash}{4d103a86280481745c9c897c925753c0}
      \field{extradatescope}{labelyear}
      \field{labeldatesource}{}
      \field{labelnamesource}{author}
      \field{labeltitlesource}{title}
      \field{journaltitle}{arXiv preprint arXiv:1406.1078}
      \field{title}{Learning phrase representations using RNN encoder-decoder for statistical machine translation}
      \field{year}{2014}
    \endentry
    \entry{garleanu2013dynamic}{article}{}{}
      \name{author}{2}{}{%
        {{un=0,uniquepart=base,hash=0c634bc5d53d9902843ba6686ad256bc}{%
           family={Gârleanu},
           familyi={G\bibinitperiod},
           given={Nicolae},
           giveni={N\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=07123ce41f03a63251aed38e35aa6029}{%
           family={Pedersen},
           familyi={P\bibinitperiod},
           given={Lasse\bibnamedelima Heje},
           giveni={L\bibinitperiod\bibinitdelim H\bibinitperiod},
           givenun=0}}%
      }
      \list{publisher}{1}{%
        {Wiley Online Library}%
      }
      \strng{namehash}{916c18d87b18e451244ac5e76b1568a8}
      \strng{fullhash}{916c18d87b18e451244ac5e76b1568a8}
      \strng{fullhashraw}{916c18d87b18e451244ac5e76b1568a8}
      \strng{bibnamehash}{916c18d87b18e451244ac5e76b1568a8}
      \strng{authorbibnamehash}{916c18d87b18e451244ac5e76b1568a8}
      \strng{authornamehash}{916c18d87b18e451244ac5e76b1568a8}
      \strng{authorfullhash}{916c18d87b18e451244ac5e76b1568a8}
      \strng{authorfullhashraw}{916c18d87b18e451244ac5e76b1568a8}
      \field{sortinit}{G}
      \field{sortinithash}{32d67eca0634bf53703493fb1090a2e8}
      \field{extradatescope}{labelyear}
      \field{labeldatesource}{}
      \field{labelnamesource}{author}
      \field{labeltitlesource}{title}
      \field{journaltitle}{The Journal of Finance}
      \field{number}{6}
      \field{title}{Dynamic trading with predictable returns and transaction costs}
      \field{volume}{68}
      \field{year}{2013}
      \field{pages}{2309\bibrangedash 2340}
      \range{pages}{32}
    \endentry
    \entry{hambly2023recent}{article}{}{}
      \name{author}{3}{}{%
        {{un=0,uniquepart=base,hash=6d9dd5545b1baec4468e75511074ebd7}{%
           family={Hambly},
           familyi={H\bibinitperiod},
           given={Ben},
           giveni={B\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=486bd88c876bf3b8cb4c8e9ea1596bf1}{%
           family={Xu},
           familyi={X\bibinitperiod},
           given={Renyuan},
           giveni={R\bibinitperiod},
           givenun=0}}%
        {{un=2,uniquepart=given,hash=445f4754f89c4ff0206d03648a0000ce}{%
           family={Yang},
           familyi={Y\bibinitperiod},
           given={Huining},
           giveni={H\bibinitperiod},
           givenun=2}}%
      }
      \list{publisher}{1}{%
        {Wiley Online Library}%
      }
      \strng{namehash}{9988fdc62041fd3e43902acf9ff04fee}
      \strng{fullhash}{9988fdc62041fd3e43902acf9ff04fee}
      \strng{fullhashraw}{9988fdc62041fd3e43902acf9ff04fee}
      \strng{bibnamehash}{9988fdc62041fd3e43902acf9ff04fee}
      \strng{authorbibnamehash}{9988fdc62041fd3e43902acf9ff04fee}
      \strng{authornamehash}{9988fdc62041fd3e43902acf9ff04fee}
      \strng{authorfullhash}{9988fdc62041fd3e43902acf9ff04fee}
      \strng{authorfullhashraw}{9988fdc62041fd3e43902acf9ff04fee}
      \field{sortinit}{H}
      \field{sortinithash}{23a3aa7c24e56cfa16945d55545109b5}
      \field{extradatescope}{labelyear}
      \field{labeldatesource}{}
      \field{labelnamesource}{author}
      \field{labeltitlesource}{title}
      \field{journaltitle}{Mathematical Finance}
      \field{number}{3}
      \field{title}{Recent advances in reinforcement learning in finance}
      \field{volume}{33}
      \field{year}{2023}
      \field{pages}{437\bibrangedash 503}
      \range{pages}{67}
    \endentry
    \entry{hamilton1989}{article}{}{}
      \name{author}{1}{}{%
        {{un=0,uniquepart=base,hash=f1528bc518ebb8f6103311513805ac7d}{%
           family={Hamilton},
           familyi={H\bibinitperiod},
           given={James\bibnamedelima D.},
           giveni={J\bibinitperiod\bibinitdelim D\bibinitperiod},
           givenun=0}}%
      }
      \list{publisher}{1}{%
        {JSTOR}%
      }
      \strng{namehash}{f1528bc518ebb8f6103311513805ac7d}
      \strng{fullhash}{f1528bc518ebb8f6103311513805ac7d}
      \strng{fullhashraw}{f1528bc518ebb8f6103311513805ac7d}
      \strng{bibnamehash}{f1528bc518ebb8f6103311513805ac7d}
      \strng{authorbibnamehash}{f1528bc518ebb8f6103311513805ac7d}
      \strng{authornamehash}{f1528bc518ebb8f6103311513805ac7d}
      \strng{authorfullhash}{f1528bc518ebb8f6103311513805ac7d}
      \strng{authorfullhashraw}{f1528bc518ebb8f6103311513805ac7d}
      \field{sortinit}{H}
      \field{sortinithash}{23a3aa7c24e56cfa16945d55545109b5}
      \field{extradatescope}{labelyear}
      \field{labeldatesource}{}
      \field{labelnamesource}{author}
      \field{labeltitlesource}{title}
      \field{journaltitle}{Econometrica}
      \field{number}{2}
      \field{title}{A new approach to the economic analysis of nonstationary time series and the business cycle}
      \field{volume}{57}
      \field{year}{1989}
      \field{pages}{357\bibrangedash 384}
      \range{pages}{28}
      \verb{doi}
      \verb 10.2307/1912559
      \endverb
    \endentry
    \entry{kolm2023deep}{article}{}{}
      \name{author}{3}{}{%
        {{un=0,uniquepart=base,hash=f068bc684f183ddcdf532a4d385b4d49}{%
           family={Kolm},
           familyi={K\bibinitperiod},
           given={Petter\bibnamedelima N},
           giveni={P\bibinitperiod\bibinitdelim N\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=5784ba012fdeea2962dd0b3dd117e0c3}{%
           family={Turiel},
           familyi={T\bibinitperiod},
           given={Jeremy},
           giveni={J\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=51dac81bcae47654a393973b845a4b4c}{%
           family={Westray},
           familyi={W\bibinitperiod},
           given={Nicholas},
           giveni={N\bibinitperiod},
           givenun=0}}%
      }
      \list{publisher}{1}{%
        {Wiley Online Library}%
      }
      \strng{namehash}{2b38a1833bebd5981c7099fe54fb10d5}
      \strng{fullhash}{2b38a1833bebd5981c7099fe54fb10d5}
      \strng{fullhashraw}{2b38a1833bebd5981c7099fe54fb10d5}
      \strng{bibnamehash}{2b38a1833bebd5981c7099fe54fb10d5}
      \strng{authorbibnamehash}{2b38a1833bebd5981c7099fe54fb10d5}
      \strng{authornamehash}{2b38a1833bebd5981c7099fe54fb10d5}
      \strng{authorfullhash}{2b38a1833bebd5981c7099fe54fb10d5}
      \strng{authorfullhashraw}{2b38a1833bebd5981c7099fe54fb10d5}
      \field{sortinit}{K}
      \field{sortinithash}{c02bf6bff1c488450c352b40f5d853ab}
      \field{extradatescope}{labelyear}
      \field{labeldatesource}{}
      \field{labelnamesource}{author}
      \field{labeltitlesource}{title}
      \field{journaltitle}{Mathematical Finance}
      \field{number}{4}
      \field{title}{Deep order flow imbalance: Extracting alpha at multiple horizons from the limit order book}
      \field{volume}{33}
      \field{year}{2023}
      \field{pages}{1044\bibrangedash 1081}
      \range{pages}{38}
    \endentry
    \entry{lillicrap2015continuous}{article}{}{}
      \name{author}{8}{}{%
        {{un=0,uniquepart=base,hash=2a321a868e44d49baf52b5e2d816fb71}{%
           family={Lillicrap},
           familyi={L\bibinitperiod},
           given={Timothy\bibnamedelima P},
           giveni={T\bibinitperiod\bibinitdelim P\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=e0c5cec59a932511b2af6220473fad61}{%
           family={Hunt},
           familyi={H\bibinitperiod},
           given={Jonathan\bibnamedelima J},
           giveni={J\bibinitperiod\bibinitdelim J\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=4295e4094c426f01903ac60155866130}{%
           family={Pritzel},
           familyi={P\bibinitperiod},
           given={Alexander},
           giveni={A\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=231312991eab5915498d6c19c2a8cd4e}{%
           family={Heess},
           familyi={H\bibinitperiod},
           given={Nicolas},
           giveni={N\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=3b79ca47f08451987877fd8682e971e5}{%
           family={Erez},
           familyi={E\bibinitperiod},
           given={Tom},
           giveni={T\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=58112cb88a80c1bc045b6eaab26a8695}{%
           family={Tassa},
           familyi={T\bibinitperiod},
           given={Yuval},
           giveni={Y\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=89dbd30410c2085cd059f32c57d4593e}{%
           family={Silver},
           familyi={S\bibinitperiod},
           given={David},
           giveni={D\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=d7805381550fb5f8360345f7f72c0b49}{%
           family={Wierstra},
           familyi={W\bibinitperiod},
           given={Daan},
           giveni={D\bibinitperiod},
           givenun=0}}%
      }
      \strng{namehash}{e9929f8db9dd2c08064f17b4d9a7c551}
      \strng{fullhash}{9f2f0357b439f9ae4a3953d81392aaa0}
      \strng{fullhashraw}{9f2f0357b439f9ae4a3953d81392aaa0}
      \strng{bibnamehash}{e9929f8db9dd2c08064f17b4d9a7c551}
      \strng{authorbibnamehash}{e9929f8db9dd2c08064f17b4d9a7c551}
      \strng{authornamehash}{e9929f8db9dd2c08064f17b4d9a7c551}
      \strng{authorfullhash}{9f2f0357b439f9ae4a3953d81392aaa0}
      \strng{authorfullhashraw}{9f2f0357b439f9ae4a3953d81392aaa0}
      \field{sortinit}{L}
      \field{sortinithash}{7c47d417cecb1f4bd38d1825c427a61a}
      \field{extradatescope}{labelyear}
      \field{labeldatesource}{}
      \field{labelnamesource}{author}
      \field{labeltitlesource}{title}
      \field{journaltitle}{arXiv preprint arXiv:1509.02971}
      \field{title}{Continuous control with deep reinforcement learning}
      \field{year}{2015}
    \endentry
    \entry{millea2021trading}{article}{}{}
      \name{author}{1}{}{%
        {{un=0,uniquepart=base,hash=b8712a020373c770b2bf158b7de75134}{%
           family={Millea},
           familyi={M\bibinitperiod},
           given={Adrian},
           giveni={A\bibinitperiod},
           givenun=0}}%
      }
      \strng{namehash}{b8712a020373c770b2bf158b7de75134}
      \strng{fullhash}{b8712a020373c770b2bf158b7de75134}
      \strng{fullhashraw}{b8712a020373c770b2bf158b7de75134}
      \strng{bibnamehash}{b8712a020373c770b2bf158b7de75134}
      \strng{authorbibnamehash}{b8712a020373c770b2bf158b7de75134}
      \strng{authornamehash}{b8712a020373c770b2bf158b7de75134}
      \strng{authorfullhash}{b8712a020373c770b2bf158b7de75134}
      \strng{authorfullhashraw}{b8712a020373c770b2bf158b7de75134}
      \field{sortinit}{M}
      \field{sortinithash}{4625c616857f13d17ce56f7d4f97d451}
      \field{extradatescope}{labelyear}
      \field{labeldatesource}{}
      \field{labelnamesource}{author}
      \field{labeltitlesource}{title}
      \field{issn}{2306-5729}
      \field{journaltitle}{Data}
      \field{number}{11}
      \field{title}{Deep Reinforcement Learning for Trading—A Critical Survey}
      \field{volume}{6}
      \field{year}{2021}
      \verb{doi}
      \verb 10.3390/data6110119
      \endverb
      \verb{urlraw}
      \verb https://www.mdpi.com/2306-5729/6/11/119
      \endverb
      \verb{url}
      \verb https://www.mdpi.com/2306-5729/6/11/119
      \endverb
    \endentry
    \entry{ning2021double}{article}{}{}
      \name{author}{3}{}{%
        {{un=0,uniquepart=base,hash=985a764bdfbcff697e0640fb754abc6c}{%
           family={Ning},
           familyi={N\bibinitperiod},
           given={Brian},
           giveni={B\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=01f7f8259f501d0f96b1e7f3f46f729f}{%
           family={Lin},
           familyi={L\bibinitperiod},
           given={Franco\bibnamedelimb Ho\bibnamedelima Ting},
           giveni={F\bibinitperiod\bibinitdelim H\bibinitperiod\bibinitdelim T\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=aa8922fa8465c0b8208b33e873a556af}{%
           family={Jaimungal},
           familyi={J\bibinitperiod},
           given={Sebastian},
           giveni={S\bibinitperiod},
           givenun=0}}%
      }
      \list{publisher}{1}{%
        {Taylor \& Francis}%
      }
      \strng{namehash}{0b67bec831828ebe829994507b0f77b7}
      \strng{fullhash}{0b67bec831828ebe829994507b0f77b7}
      \strng{fullhashraw}{0b67bec831828ebe829994507b0f77b7}
      \strng{bibnamehash}{0b67bec831828ebe829994507b0f77b7}
      \strng{authorbibnamehash}{0b67bec831828ebe829994507b0f77b7}
      \strng{authornamehash}{0b67bec831828ebe829994507b0f77b7}
      \strng{authorfullhash}{0b67bec831828ebe829994507b0f77b7}
      \strng{authorfullhashraw}{0b67bec831828ebe829994507b0f77b7}
      \field{sortinit}{N}
      \field{sortinithash}{22369a73d5f88983a108b63f07f37084}
      \field{extradatescope}{labelyear}
      \field{labeldatesource}{}
      \field{labelnamesource}{author}
      \field{labeltitlesource}{title}
      \field{journaltitle}{Applied Mathematical Finance}
      \field{number}{4}
      \field{title}{Double deep q-learning for optimal execution}
      \field{volume}{28}
      \field{year}{2021}
      \field{pages}{361\bibrangedash 380}
      \range{pages}{20}
    \endentry
    \entry{sirignano2021universal}{incollection}{}{}
      \name{author}{2}{}{%
        {{un=0,uniquepart=base,hash=63a950b98d85daffb2acb228fc44a30b}{%
           family={Sirignano},
           familyi={S\bibinitperiod},
           given={Justin},
           giveni={J\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=4adbb1a85104895dfcc25d4e2cac8cce}{%
           family={Cont},
           familyi={C\bibinitperiod},
           given={Rama},
           giveni={R\bibinitperiod},
           givenun=0}}%
      }
      \list{publisher}{1}{%
        {Routledge}%
      }
      \strng{namehash}{6b59c986207120500a67a598723a0449}
      \strng{fullhash}{6b59c986207120500a67a598723a0449}
      \strng{fullhashraw}{6b59c986207120500a67a598723a0449}
      \strng{bibnamehash}{6b59c986207120500a67a598723a0449}
      \strng{authorbibnamehash}{6b59c986207120500a67a598723a0449}
      \strng{authornamehash}{6b59c986207120500a67a598723a0449}
      \strng{authorfullhash}{6b59c986207120500a67a598723a0449}
      \strng{authorfullhashraw}{6b59c986207120500a67a598723a0449}
      \field{sortinit}{S}
      \field{sortinithash}{b164b07b29984b41daf1e85279fbc5ab}
      \field{extradatescope}{labelyear}
      \field{labeldatesource}{}
      \field{labelnamesource}{author}
      \field{labeltitlesource}{title}
      \field{booktitle}{Machine Learning and AI in Finance}
      \field{title}{Universal features of price formation in financial markets: perspectives from deep learning}
      \field{year}{2021}
      \field{pages}{5\bibrangedash 15}
      \range{pages}{11}
    \endentry
    \entry{tsantekidis2020using}{article}{}{}
      \name{author}{6}{}{%
        {{un=0,uniquepart=base,hash=66f763f8796835110cff64eba83b757d}{%
           family={Tsantekidis},
           familyi={T\bibinitperiod},
           given={Avraam},
           giveni={A\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=116f41e8e6e1c14bbba7ed9554102da1}{%
           family={Passalis},
           familyi={P\bibinitperiod},
           given={Nikolaos},
           giveni={N\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=c03f13c68f9597b35879c9518058db66}{%
           family={Tefas},
           familyi={T\bibinitperiod},
           given={Anastasios},
           giveni={A\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=f0744b29b68512658ff7aee194e520ce}{%
           family={Kanniainen},
           familyi={K\bibinitperiod},
           given={Juho},
           giveni={J\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=b680f786282bcb3b9a76782c1aa50289}{%
           family={Gabbouj},
           familyi={G\bibinitperiod},
           given={Moncef},
           giveni={M\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=130817e12d94059f0069863cd24062fc}{%
           family={Iosifidis},
           familyi={I\bibinitperiod},
           given={Alexandros},
           giveni={A\bibinitperiod},
           givenun=0}}%
      }
      \list{publisher}{1}{%
        {Elsevier}%
      }
      \strng{namehash}{8f26a284776178c3c464c6c8c51193e3}
      \strng{fullhash}{f3ba6d5ee11681b2a9795d36f1c88133}
      \strng{fullhashraw}{f3ba6d5ee11681b2a9795d36f1c88133}
      \strng{bibnamehash}{8f26a284776178c3c464c6c8c51193e3}
      \strng{authorbibnamehash}{8f26a284776178c3c464c6c8c51193e3}
      \strng{authornamehash}{8f26a284776178c3c464c6c8c51193e3}
      \strng{authorfullhash}{f3ba6d5ee11681b2a9795d36f1c88133}
      \strng{authorfullhashraw}{f3ba6d5ee11681b2a9795d36f1c88133}
      \field{sortinit}{T}
      \field{sortinithash}{9af77f0292593c26bde9a56e688eaee9}
      \field{extradatescope}{labelyear}
      \field{labeldatesource}{}
      \field{labelnamesource}{author}
      \field{labeltitlesource}{title}
      \field{journaltitle}{Applied Soft Computing}
      \field{title}{Using deep learning for price prediction by exploiting stationary limit order book features}
      \field{volume}{93}
      \field{year}{2020}
      \field{pages}{106401}
      \range{pages}{1}
    \endentry
    \entry{yang2020deep}{inproceedings}{}{}
      \name{author}{4}{}{%
        {{un=2,uniquepart=given,hash=1d4af778526f9fb5e51a585367371ae6}{%
           family={Yang},
           familyi={Y\bibinitperiod},
           given={Hongyang},
           giveni={H\bibinitperiod},
           givenun=2}}%
        {{un=0,uniquepart=base,hash=62de333ae9544c8109bebdd547b05a93}{%
           family={Liu},
           familyi={L\bibinitperiod},
           given={Xiao-Yang},
           giveni={X\bibinithyphendelim Y\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=9917594c540f99a2e883b51e5fbfd32d}{%
           family={Zhong},
           familyi={Z\bibinitperiod},
           given={Shan},
           giveni={S\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=43b335f6a8f55bab978913692ecad9bd}{%
           family={Walid},
           familyi={W\bibinitperiod},
           given={Anwar},
           giveni={A\bibinitperiod},
           givenun=0}}%
      }
      \strng{namehash}{556ce49f0de6b7e7f9ddff0bd3e80daf}
      \strng{fullhash}{bbddf94dfb6d432637dd25cc6111659f}
      \strng{fullhashraw}{bbddf94dfb6d432637dd25cc6111659f}
      \strng{bibnamehash}{556ce49f0de6b7e7f9ddff0bd3e80daf}
      \strng{authorbibnamehash}{556ce49f0de6b7e7f9ddff0bd3e80daf}
      \strng{authornamehash}{556ce49f0de6b7e7f9ddff0bd3e80daf}
      \strng{authorfullhash}{bbddf94dfb6d432637dd25cc6111659f}
      \strng{authorfullhashraw}{bbddf94dfb6d432637dd25cc6111659f}
      \field{sortinit}{Y}
      \field{sortinithash}{fd67ad5a9ef0f7456bdd9aab10fe1495}
      \field{extradatescope}{labelyear}
      \field{labeldatesource}{}
      \field{labelnamesource}{author}
      \field{labeltitlesource}{title}
      \field{booktitle}{Proceedings of the first ACM international conference on AI in finance}
      \field{title}{Deep reinforcement learning for automated stock trading: An ensemble strategy}
      \field{year}{2020}
      \field{pages}{1\bibrangedash 8}
      \range{pages}{8}
    \endentry
    \entry{zhang2019deep}{article}{}{}
      \name{author}{3}{}{%
        {{un=0,uniquepart=base,hash=75c37fe503cc9c3ef8ab9d2e2bd1e578}{%
           family={Zhang},
           familyi={Z\bibinitperiod},
           given={Zihao},
           giveni={Z\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=7bcfc3a5e6df217d673644bbe887698e}{%
           family={Zohren},
           familyi={Z\bibinitperiod},
           given={Stefan},
           giveni={S\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=05bb95ccbf018512823b22dffd9503bb}{%
           family={Roberts},
           familyi={R\bibinitperiod},
           given={Stephen},
           giveni={S\bibinitperiod},
           givenun=0}}%
      }
      \strng{namehash}{d67b2990eddb878331d1e4ce9678373f}
      \strng{fullhash}{d67b2990eddb878331d1e4ce9678373f}
      \strng{fullhashraw}{d67b2990eddb878331d1e4ce9678373f}
      \strng{bibnamehash}{d67b2990eddb878331d1e4ce9678373f}
      \strng{authorbibnamehash}{d67b2990eddb878331d1e4ce9678373f}
      \strng{authornamehash}{d67b2990eddb878331d1e4ce9678373f}
      \strng{authorfullhash}{d67b2990eddb878331d1e4ce9678373f}
      \strng{authorfullhashraw}{d67b2990eddb878331d1e4ce9678373f}
      \field{extraname}{1}
      \field{sortinit}{Z}
      \field{sortinithash}{96892c0b0a36bb8557c40c49813d48b3}
      \field{extradate}{1}
      \field{extradatescope}{labelyear}
      \field{labeldatesource}{}
      \field{labelnamesource}{author}
      \field{labeltitlesource}{title}
      \field{journaltitle}{arXiv preprint arXiv:1911.10107}
      \field{title}{Deep reinforcement learning for trading}
      \field{year}{2019}
    \endentry
    \entry{zhang2019deeplob}{article}{}{}
      \name{author}{3}{}{%
        {{un=0,uniquepart=base,hash=75c37fe503cc9c3ef8ab9d2e2bd1e578}{%
           family={Zhang},
           familyi={Z\bibinitperiod},
           given={Zihao},
           giveni={Z\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=7bcfc3a5e6df217d673644bbe887698e}{%
           family={Zohren},
           familyi={Z\bibinitperiod},
           given={Stefan},
           giveni={S\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=05bb95ccbf018512823b22dffd9503bb}{%
           family={Roberts},
           familyi={R\bibinitperiod},
           given={Stephen},
           giveni={S\bibinitperiod},
           givenun=0}}%
      }
      \list{publisher}{1}{%
        {IEEE}%
      }
      \strng{namehash}{d67b2990eddb878331d1e4ce9678373f}
      \strng{fullhash}{d67b2990eddb878331d1e4ce9678373f}
      \strng{fullhashraw}{d67b2990eddb878331d1e4ce9678373f}
      \strng{bibnamehash}{d67b2990eddb878331d1e4ce9678373f}
      \strng{authorbibnamehash}{d67b2990eddb878331d1e4ce9678373f}
      \strng{authornamehash}{d67b2990eddb878331d1e4ce9678373f}
      \strng{authorfullhash}{d67b2990eddb878331d1e4ce9678373f}
      \strng{authorfullhashraw}{d67b2990eddb878331d1e4ce9678373f}
      \field{extraname}{2}
      \field{sortinit}{Z}
      \field{sortinithash}{96892c0b0a36bb8557c40c49813d48b3}
      \field{extradate}{2}
      \field{extradatescope}{labelyear}
      \field{labeldatesource}{}
      \field{labelnamesource}{author}
      \field{labeltitlesource}{title}
      \field{journaltitle}{IEEE Transactions on Signal Processing}
      \field{number}{11}
      \field{title}{Deeplob: Deep convolutional neural networks for limit order books}
      \field{volume}{67}
      \field{year}{2019}
      \field{pages}{3001\bibrangedash 3012}
      \range{pages}{12}
    \endentry
    \entry{zou2023stock}{misc}{}{}
      \name{author}{9}{}{%
        {{un=0,uniquepart=base,hash=a3ab806319ba633fccff941372f04a92}{%
           family={Zou},
           familyi={Z\bibinitperiod},
           given={Jinan},
           giveni={J\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=9ee7809173e95d62fbfa4fc664cb81f2}{%
           family={Zhao},
           familyi={Z\bibinitperiod},
           given={Qingying},
           giveni={Q\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=7f5ba543868b677801163c6f5a751bd1}{%
           family={Jiao},
           familyi={J\bibinitperiod},
           given={Yang},
           giveni={Y\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=5dc86b4e55e190a825a26300a514b0c2}{%
           family={Cao},
           familyi={C\bibinitperiod},
           given={Haiyao},
           giveni={H\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=baf2aa3b38f467c0cb2dde08ce975a0f}{%
           family={Liu},
           familyi={L\bibinitperiod},
           given={Yanxi},
           giveni={Y\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=cf44bbd2348d3c14a51c936e2411659b}{%
           family={Yan},
           familyi={Y\bibinitperiod},
           given={Qingsen},
           giveni={Q\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=150acd70754400d6c8d061f93b3a992d}{%
           family={Abbasnejad},
           familyi={A\bibinitperiod},
           given={Ehsan},
           giveni={E\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=f54dfc8b833af99804c92edf883f3136}{%
           family={Liu},
           familyi={L\bibinitperiod},
           given={Lingqiao},
           giveni={L\bibinitperiod},
           givenun=0}}%
        {{un=0,uniquepart=base,hash=3b41be9785cf572ff38427b40393464f}{%
           family={Shi},
           familyi={S\bibinitperiod},
           given={Javen\bibnamedelima Qinfeng},
           giveni={J\bibinitperiod\bibinitdelim Q\bibinitperiod},
           givenun=0}}%
      }
      \strng{namehash}{3a993d279ee1cfe0b3785e73b3879bf5}
      \strng{fullhash}{830eb0c65bd94ab4d1e8bb9645963d80}
      \strng{fullhashraw}{830eb0c65bd94ab4d1e8bb9645963d80}
      \strng{bibnamehash}{3a993d279ee1cfe0b3785e73b3879bf5}
      \strng{authorbibnamehash}{3a993d279ee1cfe0b3785e73b3879bf5}
      \strng{authornamehash}{3a993d279ee1cfe0b3785e73b3879bf5}
      \strng{authorfullhash}{830eb0c65bd94ab4d1e8bb9645963d80}
      \strng{authorfullhashraw}{830eb0c65bd94ab4d1e8bb9645963d80}
      \field{sortinit}{Z}
      \field{sortinithash}{96892c0b0a36bb8557c40c49813d48b3}
      \field{extradatescope}{labelyear}
      \field{labeldatesource}{}
      \field{labelnamesource}{author}
      \field{labeltitlesource}{title}
      \field{eprintclass}{q-fin.GN}
      \field{eprinttype}{arXiv}
      \field{title}{Stock Market Prediction via Deep Learning Techniques: A Survey}
      \field{year}{2023}
      \verb{eprint}
      \verb 2212.12717
      \endverb
    \endentry
  \enddatalist
\endrefsection
\endinput