## 2 Materials and Methods
### Deep Learning Block  
The goal of this block is to determine a first prediction of the medium-short term trend for the currency to be traded, in the case of this article, we will refer to the EUR / USD cross. The architecture that the author wanted to use in this work is based on the use of deep long short-term memory (LSTM) networks. An exhaustive description of the LSTM architecture can be found in [22; 23]. The LSTMs architectures are basically particular types of recurrent neural networks (RNN) with a marked ability to learn long-term dependencies. LSTMs have many variations. The fundamental unit of an LSTM network is the cell. A cell consists of three data ports (input, forget, output) that process the data using a sigmoid type activation function \"\(\sigma\)\" while the cell input and status are transformed with \"_tanh_\" activation [22]. The cell is able to store (recall) values over arbitrary time intervals while above gates are able to manage the input/output data flow of the cell. The following Figure 4 shows a classical LSTM structure with a specific detail about the simple cell unit. The following Figure 5 reports the typical LSTM cell as used in the architecture proposed in this paper. Figure 3: The normalized EUR/USD, GBP/USD, EUR/GBP close price time-series (for year 2018). The mathematical model that characterizes the dynamics of the single LSTM cell is  
\[\mathbf{f}_{t} = \sigma\big{(}\mathbf{W}_{f}[\mathbf{h}_{t-1},\;\mathbf{x}_{t}]+\;\mathbf{b}_{f}\big{)}, \tag{2}\] \[\mathbf{i}_{t} = \sigma(\mathbf{W}_{i}[\mathbf{h}_{t-1},\;\mathbf{x}_{t}]+\;\mathbf{b}_{i}),\] (3) \[\widetilde{C}_{t} = tanh(\mathbf{W}_{C}[\mathbf{h}_{t-1},\;\mathbf{x}_{t}]+\;\mathbf{b}_{C}),\] (4) \[\mathbf{C}_{t} = f_{t}*\;\mathbf{C}_{t-1}+\mathbf{i}_{t}*\widetilde{C}_{t},\] (5) \[\mathbf{o}_{t} = \sigma(\mathbf{W}_{o}[\mathbf{h}_{t-1},\;\mathbf{x}_{t}]+\;\mathbf{b}_{o}),\] (6) \[\mathbf{h}_{t} = \sigma_{t}*\tanh(\mathbf{C}_{t}), \tag{7}\]  
where  
* \(\mathbf{W}_{t}\), \(\mathbf{W}_{i}\), \(\mathbf{W}_{C}\), \(\mathbf{W}_{o}\) represent the LSTM weights
* \(\mathbf{b}_{t}\), \(\mathbf{b}_{i}\), \(\mathbf{b}_{C}\), \(\mathbf{b}_{o}\) represent the used biases for each cell
* \(\mathbf{C}_{t}\) represents the cell state  
Therefore, during the data processing phase performed by the LSTM network, the input data (the set of financial time-series of the cross currency chosen to define a triangular arbitration) will be properly processed by means of the equations defined above, establishing--in simple words--which dynamics of input data keep in memory and discard (forget gate). More details on the LSTMs architectures in [24]. LSTM architectures can be used effectively to classify signals or in general data on input [25, 26]. For these reasons, the author has equipped the proposed LSTM based deep pipeline with a fully-connected neuronal layer with a SoftMax layer and a classifier in cascade. The final classification layer  
Figure 4: Deep LSTM model with a detail about the cell unit. Figure 5: Classical LSTM cell diagram. uses the probabilities returned by the SoftMax activation function for each input to assign the input to one of the mutually exclusive classes and compute the loss and performance indexes. In this way, our pipeline will be able to process the input data (financial currency time-series) through the LSTM cells therefore to appropriately classify the features thus generated through the SoftMax layer and classifier. A similar classification pipelines have been used effectively by the author in appropriately classifying both signals and images albeit in different areas than the financial one here described [27; 28; 29; 30; 31]. This confirms that the approach of cascading a SoftMax block with classifier to a deep network capable of extracting features from input data (LSTMs, convolutional neural networks, auto-encoders, etc.) is certainly robust as well as performing with regard to discriminative capacity [32].