skip to main content
10.1145/3490354.3494366acmconferencesArticle/Chapter ViewAbstractPublication PagesicaifConference Proceedingsconference-collections
research-article

FinRL: deep reinforcement learning framework to automate trading in quantitative finance

Published:04 May 2022Publication History

ABSTRACT

Deep reinforcement learning (DRL) has been envisioned to have a competitive edge in quantitative finance. However, there is a steep development curve for quantitative traders to obtain an agent that automatically positions to win in the market, namely to decide where to trade, at what price and what quantity, due to the error-prone programming and arduous debugging. In this paper, we present the first open-source framework FinRL as a full pipeline to help quantitative traders overcome the steep learning curve. FinRL is featured with simplicity, applicability and extensibility under the key principles, full-stack framework, customization, reproducibility and hands-on tutoring.

Embodied as a three-layer architecture with modular structures, FinRL implements fine-tuned state-of-the-art DRL algorithms and common reward functions, while alleviating the debugging workloads. Thus, we help users pipeline the strategy design at a high turnover rate. At multiple levels of time granularity, FinRL simulates various markets as training environments using historical data and live trading APIs. Being highly extensible, FinRL reserves a set of user-import interfaces and incorporates trading constraints such as market friction, market liquidity and investor's risk-aversion. Moreover, serving as practitioners' stepping stones, typical trading tasks are provided as step-by-step tutorials, e.g., stock trading, portfolio allocation, cryptocurrency trading, etc.

References

  1. Joshua Achiam. 2018. Spinning up in deep reinforcement learning. https://spinningup.openai.comGoogle ScholarGoogle Scholar
  2. Andrew Ang. August 10, 2012. Mean-variance investing. Columbia Business School Research Paper No. 12/49. (August 10, 2012).Google ScholarGoogle Scholar
  3. Wenhang Bao and Xiao-Yang Liu. 2019. Multi-agent deep reinforcement learning for liquidation strategy analysis. ICML Workshop on Applications and Infrastructure for Multi-Agent Learning (2019).Google ScholarGoogle Scholar
  4. Stelios D Bekiros. 2010. Fuzzy adaptive decision-making for boundedly rational traders in speculative stock markets. European Journal of Operational Research 202, 1 (2010), 285--293.Google ScholarGoogle ScholarCross RefCross Ref
  5. Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. 2016. OpenAI gym. arXiv preprint arXiv:1606.01540 (2016).Google ScholarGoogle Scholar
  6. Hans Buehler, Lukas Gonon, Josef Teichmann, Ben Wood, Baranidharan Mohan, and Jonathan Kochems. 2019. Deep hedging: Hedging derivatives under generic market frictions using reinforcement learning. Swiss Finance Institute Research Paper 19--80 (2019).Google ScholarGoogle ScholarCross RefCross Ref
  7. Pablo Samuel Castro, Subhodeep Moitra, Carles Gelada, Saurabh Kumar, and Marc G. Bellemare. 2018. Dopamine: A research framework for deep reinforcement learning. http://arxiv.org/abs/1812.06110 (2018).Google ScholarGoogle Scholar
  8. Ltd China Securities Index Co. 2017. CSI 300. http://www.csindex.com.cn/uploads/indices/detail/files/en/145_000300_Fact_Sheet_en.pdfGoogle ScholarGoogle Scholar
  9. Yue Deng, Feng Bao, Youyong Kong, Zhiquan Ren, and Qionghai Dai. 2016. Deep direct reinforcement learning for financial signal representation and trading. IEEE Transactions on Neural Networks and Learning Systems 28, 3 (2016), 653--664.Google ScholarGoogle ScholarCross RefCross Ref
  10. Prafulla Dhariwal, Christopher Hesse, Oleg Klimov, Alex Nichol, Matthias Plappert, Alec Radford, John Schulman, Szymon Sidor, Yuhuai Wu, and Peter Zhokhov. 2017. OpenAI baselines. https://github.com/openai/baselines.Google ScholarGoogle Scholar
  11. Hao Dong, Akara Supratak, Luo Mai, Fangde Liu, Axel Oehmichen, Simiao Yu, and Yike Guo. 2017. TensorLayer: A versatile library for efficient deep learning development. In Proceedings of the 25th ACM International Conference on Multimedia. 1201--1204.Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Shanghai Stock Exchange. 2018. SSE 180 Index Methodology. http://www.sse.com.cn/market/sseindex/indexlist/indexdetails/indexmethods/c/IndexHandbook_EN_SSE180.pdfGoogle ScholarGoogle Scholar
  13. Thomas G. Fischer. 2018. Reinforcement learning in financial markets-asurvey. FAU Discussion Papers in Economics. Friedrich-Alexander University Erlangen-Nuremberg, Institute for Economics.Google ScholarGoogle Scholar
  14. Scott Fujimoto, Herke Van Hoof, and David Meger. 2018. Addressing function approximation error in actor-critic methods. International Conference on Machine Learning (2018).Google ScholarGoogle Scholar
  15. Prakhar Ganesh and Puneet Rakheja. 2018. Deep reinforcement learning in high frequency trading. ArXiv abs/1809.01506 (2018).Google ScholarGoogle Scholar
  16. Sumitra Ganesh, Nelson Vadori, Mengda Xu, Hua Zheng, Prashant Reddy, and Manuela Veloso. 2019. Reinforcement learning for market making in a multi-agent dealer market. NeurIPS'19 Workshop on Robust AI in Financial Services.Google ScholarGoogle Scholar
  17. Mao Guan and Xiao-Yang Liu. 2021. Explainable deep reinforcement learning for portfolio management: an empirical approach. ACM International Conference on AI in Finance (ICAIF) (2021).Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Chien Yi Huang. 2018. Financial trading as a game: A deep reinforcement learning approach. arXiv preprint arXiv:1807.02787 (2018).Google ScholarGoogle Scholar
  19. Hang Seng Index. 2020. Hang Seng index and sub-indexes. https://www.hsi.com.hk/eng/indexes/all-indexes/hsiGoogle ScholarGoogle Scholar
  20. Zhengyao Jiang and J. Liang. 2017. Cryptocurrency portfolio management with deep reinforcement learning. Intelligent Systems Conference (IntelliSys) (2017), 905--913.Google ScholarGoogle Scholar
  21. Zhengyao Jiang, Dixing Xu, and J. Liang. 2017. A deep reinforcement learning framework for the financial portfolio management problem. ArXiv abs/1706.10059.Google ScholarGoogle Scholar
  22. Prahlad Koratamaddi, Karan Wadhwani, Mridul Gupta, and Sriram G. Sanjeevi. 2021. Market sentiment-aware deep reinforcement learning approach for stock portfolio allocation. Engineering Science and Technology, an International Journal.Google ScholarGoogle Scholar
  23. Mark Kritzman and Yuanzhen Li. 2010. Skulls, financial turbulence, and risk management. Financial Analysts Journal 66 (10 2010).Google ScholarGoogle Scholar
  24. Zechu Li, Xiao-Yang Liu, jiahao Zheng, Zhaoran Wang, Anwar Walid, and Jian Guo. 2021. FinRL-Podracer: High performance and scalable deep reinforcement learning for quantitative finance. ACM International Conference on AI in Finance (ICAIF) (2021).Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Eric Liang, Richard Liaw, Robert Nishihara, Philipp Moritz, Roy Fox, Ken Goldberg, Joseph E. Gonzalez, Michael I. Jordan, and Ion Stoica. 2018. RLlib: Abstractions for distributed reinforcement learning. In International Conference on Machine Learning (ICML).Google ScholarGoogle Scholar
  26. Timothy P Lillicrap, Jonathan J Hunt, Alexander Pritzel, Nicolas Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. 2016. Continuous control with deep reinforcement learning. ICLR (2016).Google ScholarGoogle Scholar
  27. Siyu Lin and P. Beling. 2020. A deep reinforcement learning framework for optimal trade execution. In ECML/PKDD.Google ScholarGoogle Scholar
  28. Xiao-Yang Liu, Zechu Li, Zhaoran Wang, and Jiahao Zheng. 2021. ElegantRL: A scalable and elastic deep reinforcement learning library. https://github.com/AI4Finance-Foundation/ElegantRL.Google ScholarGoogle Scholar
  29. Xiao-Yang Liu, Zechu Li, Zhuoran Yang, Jiahao Zheng, Zhaoran Wang, Anwar Walid, Jian Guo, and Michael Jordan. 2021. ElegantRL-Podracer: Scalable and elastic library for cloud-native deep reinforcement learning. Deep RL Workshop, NeurIPS 2021 (2021).Google ScholarGoogle Scholar
  30. Xiao-Yang Liu, Jingyang Rui, Jiechao Gao, Liuqing Yang, Hongyang Yang, Zhaoran Wang, Christina Dan Wang, and Guo Jian. 2021. Data-driven deep reinforcement learning in quantitative finance. Data-Centric AI Workshop, NeurIPS.Google ScholarGoogle Scholar
  31. B. G. Malkiel. 2003. Passive investment strategies and efficient markets. European Financial Management 9 (2003), 1--10.Google ScholarGoogle ScholarCross RefCross Ref
  32. Volodymyr Mnih, Adria Puigdomenech Badia, Mehdi Mirza, Alex Graves, Timothy Lillicrap, Tim Harley, David Silver, and Koray Kavukcuoglu. 2016. Asynchronous methods for deep reinforcement learning. In International Conference on Machine Learning. 1928--1937.Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. John Moody and Matthew Saffell. 2001. Learning to trade via direct reinforcement. IEEE Transactions on Neural Networks 12, 4 (2001), 875--889.Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. J. Moody, L. Wu, Y. Liao, and M. Saffell. 1998. Performance functions and reinforcement learning for trading systems and portfolios. Journal of Forecasting 17 (1998), 441--470.Google ScholarGoogle ScholarCross RefCross Ref
  35. Abhishek Nan, Anandh Perumal, and Osmar R Zaiane. 2020. Sentiment and knowledge based algorithmic trading with deep reinforcement learning. ArXiv abs/2001.09403 (2020).Google ScholarGoogle Scholar
  36. Quantopian. 2019. Pyfolio: A toolkit for portfolio and risk analytics in Python. https://github.com/quantopian/pyfolio.Google ScholarGoogle Scholar
  37. Antonin Raffin, Ashley Hill, Maximilian Ernestus, Adam Gleave, Anssi Kanervisto, and Noah Dormann. 2019. Stable Baselines3. https://github.com/DLR-RM/stable-baselines3.Google ScholarGoogle Scholar
  38. Francesco Rundo. 2019. Deep LSTM with reinforcement learning layer for financial trend prediction in FX high frequency trading systems. Applied Sciences 9 (10 2019), 1--18.Google ScholarGoogle Scholar
  39. Jonathan Sadighian. 2019. Deep reinforcement learning in cryptocurrency market making. arXiv: Trading and Market Microstructure (2019).Google ScholarGoogle Scholar
  40. Svetlana Sapuric and A. Kokkinaki. 2014. Bitcoin is volatile! Isn't that right?. In BIS.Google ScholarGoogle Scholar
  41. Otabek Sattarov, Azamjon Muminov, Cheol Lee, Hyun Kang, Ryumduck Oh, Junho Ahn, Hyung Oh, and Heung Jeon. 2020. Recommending cryptocurrency trading points with deep reinforcement learning approach. Applied Sciences 10.Google ScholarGoogle Scholar
  42. John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. 2017. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347 (2017).Google ScholarGoogle Scholar
  43. William F Sharpe. 1970. Portfolio theory and capital markets. McGraw-Hill College.Google ScholarGoogle Scholar
  44. David Silver, Aja Huang, Chris J Maddison, Arthur Guez, Laurent Sifre, George Van Den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, et al. 2016. Mastering the game of Go with deep neural networks and tree search. Nature 529, 7587 (2016), 484.Google ScholarGoogle Scholar
  45. Richard S. Sutton, David Mcallester, Satinder Singh, and Yishay Mansour. 2000. Policy gradient methods for reinforcement learning with function approximation. In Advances in Neural Information Processing Systems 12. MIT Press, 1057--1063.Google ScholarGoogle Scholar
  46. Evgeni B. Tarassov. 2016. Exchange traded funds (ETF): History, mechanism, academic literature review and research perspectives. Microeconomics: General Equilibrium & Disequilibrium Models of Financial Markets eJournal (2016).Google ScholarGoogle Scholar
  47. Nelson Vadori, Sumitra Ganesh, Prashant Reddy, and Manuela Veloso. 2020. Risk-sensitive reinforcement learning: a martingale approach to reward uncertainty. International Conference on AI in Finance (ICAIF) (2020).Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. Svitlana Vyetrenko, David Byrd, Nick Petosa, Mahmoud Mahfouz, Danial Dervovic, Manuela Veloso, and Tucker Hybinette Balch. 2020. Get real: Realism metrics for robust limit order book market simulations. International Conference on AI in Finance (ICAIF) (2020).Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. Christopher JCH Watkins and Peter Dayan. 1992. Q-learning. Machine Learning 8, 3--4 (1992), 279--292.Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. Zhuoran Xiong, Xiao-Yang Liu, Shan Zhong, Hongyang Yang, and Anwar Walid. 2018. Practical deep reinforcement learning approach for stock trading. NeurIPS Workshop (2018).Google ScholarGoogle Scholar
  51. Hongyang Yang, Xiao-Yang Liu, Shan Zhong, and Anwar Walid. 2020. Deep reinforcement learning for automated stock trading: An ensemble strategy. ACM International Conference on AI in Finance (ICAIF) (2020).Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. Daochen Zha, Kwei-Herng Lai, Kaixiong Zhou, and X. X. Hu. 2019. Experience replay optimization. International Joint Conference on Artificial Intelligence (IJCAI).Google ScholarGoogle Scholar
  53. Yong Zhang and Xingyu Yang. 2017. Online portfolio selection strategy based on combining experts' advice. Computational Economics 50, 1 (2017), 141--159.Google ScholarGoogle ScholarDigital LibraryDigital Library
  54. Zihao Zhang, Stefan Zohren, and Stephen Roberts. 2020. Deep reinforcement learning for trading. The Journal of Financial Data Science 2, 2 (2020), 25--40.Google ScholarGoogle ScholarCross RefCross Ref

Index Terms

  1. FinRL: deep reinforcement learning framework to automate trading in quantitative finance

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • Published in

        cover image ACM Conferences
        ICAIF '21: Proceedings of the Second ACM International Conference on AI in Finance
        November 2021
        450 pages
        ISBN:9781450391481
        DOI:10.1145/3490354

        Copyright © 2021 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 4 May 2022

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader