Resumo:
Financial time series predictions are a challenge due to their nonlinear and chaotic nature. In
recent decades, many researchers and investors have studied methods to improve quantitative
analysis. In the field of artificial intelligence, sophisticated machine learning techniques, such
as deep learning showed better performance. In this work, an automated trading system, an
algotrading, to predict future trends of stock index prices Ibovespa is showed and evaluated.
Using an LSTM-based (Long Short-Term Memory) agent to learn temporal patterns in the data,
the algorithm triggers automatic trades according to the historical data, technical analysis indicators, and risk management. Initially, five different strategies were developed using the LSTM
algorithm as a basis, then the model that reported the best performance was selected. During the
experimental tests, it was possible to prove that the use of trading strategy and risk management
techniques helped to minimize losses and reduce operating costs, which have a direct influence
on profitability. Subsequently, the model that obtained the best result, the LSTM-RMODV, underwent several improvements. Among them, the implementation of the Break-even and Trailing Stop techniques, and a series of optimizations for the trading strategy. Then, it was possible
to obtain a set of parameters that brought better results to the ATS (Automated Trading System),
giving rise to the new model called Algo-LSTM. In the last step, the evaluation of slippage alow
to infer that in the long-term the impact of slippage under reasonable market conditions is not
significant for the final result. Finally, the results demonstrated that the proposed method, AlgoLSTM, shows better performance when compared with other methods, including the buy-andhold technique. The proposed method also works in bear or bull market conditions, showing a
rate over net income based on invested capital of 208.23% in 2019 and 112,81% in 2015. That
is, despite the low accuracy, the algorithm is capable of generating consistent profits when all
the transaction costs and the income tax over net revenue are considered.