Abstract
The forex market is a difficult market for traders to succeed. The high noise and volatility of the forex market make the traders very hard to open and close position accurately. Many approaches have been proposed to overcome these difficulties, including algorithmic trading. This research proposed a framework for algorithmic trading using Q-learning with the help of LSTM. The proposed framework uses a finite state space in reinforcement learning to use holding time and higher timeframe market data. The state space is designed so that the agent can open and close positions flexibly, without being restricted by a fixed time window. This allows the agent to take profits and avoid losses. The proposed framework was trained and tested using 15 years’ worth of historical data of the EUR/USD currency pair in 5-min timeframe data. The system was evaluated based on various metrics such as profit, drawdown, Sharpe ratio, holding time, and delta time. The results show that with its designed finite state space and flexible time window, the proposed framework achieved consistent profits, reduced losses, and increased overall profits. This suggests that the proposed framework may be a suitable solution for forex market trading.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
References
Hayley, S., Marsh, I.W.: What do retail FX traders learn? J. Int. Money Financ. 64, 16–38 (2016). https://doi.org/10.1016/J.JIMONFIN.2016.02.001
Moeeni, S.: Is It Necessary to Restrict Forex Financial Trading ? A Modified Model 1 Introduction, vol. 13(1), pp. 63–80 (2019)
Shavandi, A., Khedmati, M.: A multi-agent deep reinforcement learning framework for algorithmic trading in financial markets. Expert Syst. Appl. 208, 118124 (2022): https://doi.org/10.1016/j.eswa.2022.118124
Chakole, J.B., Kolhe, M.S., Mahapurush, G.D., Yadav, A., Kurhekar, M.P.: A Q-learning agent for automated trading in equity stock markets. Expert Syst. Appl. 163, 113761 (2021). https://doi.org/10.1016/j.eswa.2020.113761
Huang, C.Y.: Financial Trading as a Game: A Deep Reinforcement Learning Approach, pp. 1–15 (2018). http://arxiv.org/abs/1807.02787
Carapuço, J., Neves, R., Horta, N.: Reinforcement learning applied to Forex trading. Appl. Soft Comput. J. 73, 783–794 (2018). https://doi.org/10.1016/j.asoc.2018.09.017
Zarkias, K.S., Passalis, N., Tsantekidis, A., Tefas, A.: Deep reinforcement learning for financial trading using price trailing. In: ICASSP, International Conference on Acoustics, Speech, and Signal Processing Proceedings, vol. 2019, pp. 3067–3071 (May 2019). https://doi.org/10.1109/ICASSP.2019.8683161
Pring, M.J.: Technical analysis explained : the successful investor’s guide to spotting investment trends and turning points, p. 797
Treleaven, P., Galas, M., Lalchand, V.: Algorithmic trading review. Commun. ACM 56(11), 76–85 (2013). https://doi.org/10.1145/2500117
Fundamental analysis in the multi-agent trading system | IEEE Conference Publication | IEEE Xplore. https://ieeexplore.ieee.org/abstract/document/7733396 (Accessed 02 Feb 2023)
Wanniarachchi, H.J., Rathnayake, R.M.S.J.K., Thilina, S.G.I., Ganegoda, G.U., Manawadu, I.: Macroeconomic event base expert advisor for forex trades: through algo trading. In: 21st International Conference on Advances in ICT for Emerging Regions, ICter 2021 - Proceedings, pp. 189–194 (2021). https://doi.org/10.1109/ICTER53630.2021.9774804
Salkar, T., Shinde, A., Tamhankar, N., Bhagat, N.: Algorithmic trading using technical indicators. In: Proceedings of International Conference on Communication, Information and Computing Technology, ICCICT 2021 (2021). https://doi.org/10.1109/ICCICT50803.2021.9510135
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2023 IFIP International Federation for Information Processing
About this paper
Cite this paper
Zahrah, H.H., Tirtawangsa, J. (2023). Algorithmic Forex Trading Using Q-learning. In: Maglogiannis, I., Iliadis, L., MacIntyre, J., Dominguez, M. (eds) Artificial Intelligence Applications and Innovations. AIAI 2023. IFIP Advances in Information and Communication Technology, vol 675. Springer, Cham. https://doi.org/10.1007/978-3-031-34111-3_3
Download citation
DOI: https://doi.org/10.1007/978-3-031-34111-3_3
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-34110-6
Online ISBN: 978-3-031-34111-3
eBook Packages: Computer ScienceComputer Science (R0)