IDEAS home Printed from https://ideas.repec.org/p/arx/papers/2209.07823.html
   My bibliography  Save this paper

Model-based gym environments for limit order book trading

Author

Listed:
  • Joseph Jerome
  • Leandro Sanchez-Betancourt
  • Rahul Savani
  • Martin Herdegen

Abstract

Within the mathematical finance literature there is a rich catalogue of mathematical models for studying algorithmic trading problems -- such as market-making and optimal execution -- in limit order books. This paper introduces \mbtgym, a Python module that provides a suite of gym environments for training reinforcement learning (RL) agents to solve such model-based trading problems. The module is set up in an extensible way to allow the combination of different aspects of different models. It supports highly efficient implementations of vectorized environments to allow faster training of RL agents. In this paper, we motivate the challenge of using RL to solve such model-based limit order book problems in mathematical finance, we explain the design of our gym environment, and then demonstrate its use in solving standard and non-standard problems from the literature. Finally, we lay out a roadmap for further development of our module, which we provide as an open source repository on GitHub so that it can serve as a focal point for RL research in model-based algorithmic trading.

Suggested Citation

  • Joseph Jerome & Leandro Sanchez-Betancourt & Rahul Savani & Martin Herdegen, 2022. "Model-based gym environments for limit order book trading," Papers 2209.07823, arXiv.org.
  • Handle: RePEc:arx:papers:2209.07823
    as

    Download full text from publisher

    File URL: http://arxiv.org/pdf/2209.07823
    File Function: Latest version
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Álvaro Cartea & Yixuan Wang, 2020. "Market Making With Alpha Signals," International Journal of Theoretical and Applied Finance (IJTAF), World Scientific Publishing Co. Pte. Ltd., vol. 23(03), pages 1-26, May.
    2. �lvaro Cartea & Sebastian Jaimungal, 2015. "Optimal execution with limit and market orders," Quantitative Finance, Taylor & Francis Journals, vol. 15(8), pages 1279-1291, August.
    3. Fr'ed'eric Abergel & C^ome Hur'e & Huy^en Pham, 2017. "Algorithmic trading in a microstructural limit order book model," Papers 1705.01446, arXiv.org, revised Feb 2020.
    4. Olivier Gu'eant & Charles-Albert Lehalle & Joaquin Fernandez Tapia, 2011. "Dealing with the Inventory Risk. A solution to the market making problem," Papers 1105.3115, arXiv.org, revised Aug 2012.
    5. Martin D. Gould & Mason A. Porter & Stacy Williams & Mark McDonald & Daniel J. Fenn & Sam D. Howison, 2010. "Limit Order Books," Papers 1012.0349, arXiv.org, revised Apr 2013.
    6. Álvaro Cartea & Ryan Donnelly & Sebastian Jaimungal, 2018. "Enhancing trading strategies with order book signals," Applied Mathematical Finance, Taylor & Francis Journals, vol. 25(1), pages 1-35, January.
    7. Thomas Spooner & Rahul Savani, 2020. "Robust Market Making via Adversarial Reinforcement Learning," Papers 2003.01820, arXiv.org, revised Jul 2020.
    8. Frédéric Abergel & Côme Huré & Huyên Pham, 2020. "Algorithmic trading in a microstructural limit order book model," Post-Print hal-01514987, HAL.
    9. Rama Cont & Sasha Stoikov & Rishi Talreja, 2010. "A Stochastic Model for Order Book Dynamics," Operations Research, INFORMS, vol. 58(3), pages 549-563, June.
    10. Joseph Jerome & Gregory Palmer & Rahul Savani, 2022. "Market Making with Scaled Beta Policies," Papers 2207.03352, arXiv.org, revised Sep 2022.
    11. Selim Amrouni & Aymeric Moulin & Jared Vann & Svitlana Vyetrenko & Tucker Balch & Manuela Veloso, 2021. "ABIDES-Gym: Gym Environments for Multi-Agent Discrete Event Simulation and Application to Financial Markets," Papers 2110.14771, arXiv.org.
    12. Olivier Guéant, 2017. "Optimal market making," Applied Mathematical Finance, Taylor & Francis Journals, vol. 24(2), pages 112-154, March.
    13. Martin Forde & Leandro Sánchez-Betancourt & Benjamin Smith, 2022. "Optimal trade execution for Gaussian signals with power-law resilience," Quantitative Finance, Taylor & Francis Journals, vol. 22(3), pages 585-596, March.
    14. Tucker Hybinette Balch & Mahmoud Mahfouz & Joshua Lockhart & Maria Hybinette & David Byrd, 2019. "How to Evaluate Trading Strategies: Single Agent Market Replay or Multiple Agent Interactive Simulation?," Papers 1906.12010, arXiv.org.
    15. Philippe Bergault & Fayc{c}al Drissi & Olivier Gu'eant, 2021. "Multi-asset optimal execution and statistical arbitrage strategies under Ornstein-Uhlenbeck dynamics," Papers 2103.13773, arXiv.org, revised Mar 2022.
    16. Weston Barger & Matthew Lorig, 2019. "Optimal Liquidation Under Stochastic Price Impact," International Journal of Theoretical and Applied Finance (IJTAF), World Scientific Publishing Co. Pte. Ltd., vol. 22(02), pages 1-28, March.
    17. Ryan Donnelly & Matthew Lorig, 2020. "Optimal Trading with Differing Trade Signals," Papers 2006.13585, arXiv.org, revised Oct 2020.
    18. Ryan Donnelly & Matthew Lorig, 2020. "Optimal Trading with Differing Trade Signals," Applied Mathematical Finance, Taylor & Francis Journals, vol. 27(4), pages 317-344, July.
    19. Xuefeng Gao & Yunhan Wang, 2020. "Optimal market making in the presence of latency," Quantitative Finance, Taylor & Francis Journals, vol. 20(9), pages 1495-1512, September.
    20. Fabien Guilbaud & Huyên Pham, 2013. "Optimal high-frequency trading with limit and market orders," Quantitative Finance, Taylor & Francis Journals, vol. 13(1), pages 79-94, January.
    21. Ho, Thomas & Stoll, Hans R., 1981. "Optimal dealer pricing under transactions and return uncertainty," Journal of Financial Economics, Elsevier, vol. 9(1), pages 47-73, March.
    22. Bastien Baldacci & Philippe Bergault & Olivier Guéant, 2021. "Algorithmic market making for options," Quantitative Finance, Taylor & Francis Journals, vol. 21(1), pages 85-97, January.
    23. Yagna Patel, 2018. "Optimizing Market Making using Multi-Agent Reinforcement Learning," Papers 1812.10252, arXiv.org.
    24. Marco Avellaneda & Sasha Stoikov, 2008. "High-frequency trading in a limit order book," Quantitative Finance, Taylor & Francis Journals, vol. 8(3), pages 217-224.
    25. Jean-Pierre Fouque & Sebastian Jaimungal & Yuri F. Saporito, 2021. "Optimal Trading with Signals and Stochastic Price Impact," Papers 2101.10053, arXiv.org, revised Aug 2023.
    26. Nicholas T. Chan and Christian Shelton, 2001. "An Adaptive Electronic Market-Maker," Computing in Economics and Finance 2001 146, Society for Computational Economics.
    27. Glosten, Lawrence R. & Milgrom, Paul R., 1985. "Bid, ask and transaction prices in a specialist market with heterogeneously informed traders," Journal of Financial Economics, Elsevier, vol. 14(1), pages 71-100, March.
    28. Charles-Albert Lehalle & Eyal Neuman, 2019. "Incorporating signals into optimal trading," Finance and Stochastics, Springer, vol. 23(2), pages 275-311, April.
    29. Sumitra Ganesh & Nelson Vadori & Mengda Xu & Hua Zheng & Prashant Reddy & Manuela Veloso, 2019. "Reinforcement Learning for Market Making in a Multi-agent Dealer Market," Papers 1911.05892, arXiv.org.
    30. Bertsimas, Dimitris & Lo, Andrew W., 1998. "Optimal control of execution costs," Journal of Financial Markets, Elsevier, vol. 1(1), pages 1-50, April.
    31. Eyal Neuman & Moritz Vo{ss}, 2020. "Optimal Signal-Adaptive Trading with Temporary and Transient Price Impact," Papers 2002.09549, arXiv.org, revised Jan 2022.
    32. Philippe Bergault & Fayçal Drissi & Olivier Guéant, 2022. "Multi-asset Optimal Execution and Statistical Arbitrage Strategies under Ornstein--Uhlenbeck Dynamics," Post-Print hal-03680071, HAL.
    33. Xuefeng Gao & Yunhan Wang, 2018. "Optimal Market Making in the Presence of Latency," Papers 1806.05849, arXiv.org, revised Mar 2020.
    34. Alessandro Micheli & Johannes Muhle-Karbe & Eyal Neuman, 2021. "Closed-Loop Nash Competition for Liquidity," Papers 2112.02961, arXiv.org, revised Jun 2023.
    35. Alexander Barzykin & Philippe Bergault & Olivier Gu'eant, 2022. "Dealing with multi-currency inventory risk in FX cash markets," Papers 2207.04100, arXiv.org, revised Oct 2023.
    36. Jonathan Sadighian, 2019. "Deep Reinforcement Learning in Cryptocurrency Market Making," Papers 1911.08647, arXiv.org.
    37. Olivier Guéant, 2016. "The Financial Mathematics of Market Liquidity: From Optimal Execution to Market Making," Post-Print hal-01393136, HAL.
    38. Frédéric Abergel & Côme Huré & Huyên Pham, 2020. "Algorithmic trading in a microstructural limit order book model," Quantitative Finance, Taylor & Francis Journals, vol. 20(8), pages 1263-1283, August.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Marcello Monga, 2024. "Automated Market Making and Decentralized Finance," Papers 2407.16885, arXiv.org.
    2. Bruno Gašperov & Stjepan Begušić & Petra Posedel Šimović & Zvonko Kostanjčar, 2021. "Reinforcement Learning Approaches to Optimal Market Making," Mathematics, MDPI, vol. 9(21), pages 1-22, October.
    3. Joseph Jerome & Gregory Palmer & Rahul Savani, 2022. "Market Making with Scaled Beta Policies," Papers 2207.03352, arXiv.org, revised Sep 2022.
    4. 'Alvaro Cartea & Fayc{c}al Drissi & Marcello Monga, 2023. "Decentralised Finance and Automated Market Making: Predictable Loss and Optimal Liquidity Provision," Papers 2309.08431, arXiv.org, revised Jun 2024.
    5. Olivier Guéant, 2016. "The Financial Mathematics of Market Liquidity: From Optimal Execution to Market Making," Post-Print hal-01393136, HAL.
    6. Philippe Bergault & Louis Bertucci & David Bouba & Olivier Gu'eant, 2022. "Automated Market Makers: Mean-Variance Analysis of LPs Payoffs and Design of Pricing Functions," Papers 2212.00336, arXiv.org, revised Nov 2023.
    7. Alexander Barzykin & Philippe Bergault & Olivier Gu'eant, 2021. "Algorithmic market making in dealer markets with hedging and market impact," Papers 2106.06974, arXiv.org, revised Dec 2022.
    8. Hui Niu & Siyuan Li & Jiahao Zheng & Zhouchi Lin & Jian Li & Jian Guo & Bo An, 2023. "IMM: An Imitative Reinforcement Learning Approach with Predictive Representation Learning for Automatic Market Making," Papers 2308.08918, arXiv.org.
    9. 'Alvaro Cartea & Fayc{c}al Drissi & Marcello Monga, 2023. "Decentralised Finance and Automated Market Making: Execution and Speculation," Papers 2307.03499, arXiv.org, revised Jul 2024.
    10. Nelson Vadori & Leo Ardon & Sumitra Ganesh & Thomas Spooner & Selim Amrouni & Jared Vann & Mengda Xu & Zeyu Zheng & Tucker Balch & Manuela Veloso, 2022. "Towards Multi-Agent Reinforcement Learning driven Over-The-Counter Market Simulations," Papers 2210.07184, arXiv.org, revised Aug 2023.
    11. Jiafa He & Cong Zheng & Can Yang, 2023. "Integrating Tick-level Data and Periodical Signal for High-frequency Market Making," Papers 2306.17179, arXiv.org.
    12. Jonathan Ch'avez-Casillas & Jos'e E. Figueroa-L'opez & Chuyi Yu & Yi Zhang, 2024. "Adaptive Optimal Market Making Strategies with Inventory Liquidation Cos," Papers 2405.11444, arXiv.org.
    13. Christoph Kuhn & Johannes Muhle-Karbe, 2013. "Optimal Liquidity Provision," Papers 1309.5235, arXiv.org, revised Feb 2015.
    14. Bastien Baldacci & Jerome Benveniste & Gordon Ritter, 2020. "Optimal trading without optimal control," Papers 2012.12945, arXiv.org.
    15. Alexander Barzykin & Philippe Bergault & Olivier Guéant, 2023. "Algorithmic market making in dealer markets with hedging and market impact," Mathematical Finance, Wiley Blackwell, vol. 33(1), pages 41-79, January.
    16. Jialiang Luo & Harry Zheng, 2021. "Dynamic Equilibrium of Market Making with Price Competition," Dynamic Games and Applications, Springer, vol. 11(3), pages 556-579, September.
    17. Kühn, Christoph & Muhle-Karbe, Johannes, 2015. "Optimal liquidity provision," Stochastic Processes and their Applications, Elsevier, vol. 125(7), pages 2493-2515.
    18. Pankaj Kumar, 2021. "Deep Hawkes Process for High-Frequency Market Making," Papers 2109.15110, arXiv.org.
    19. Qinghua Li, 2014. "Facilitation and Internalization Optimal Strategy in a Multilateral Trading Context," Papers 1404.7320, arXiv.org, revised Jan 2015.
    20. Baron Law & Frederi Viens, 2019. "Market Making under a Weakly Consistent Limit Order Book Model," Papers 1903.07222, arXiv.org, revised Jan 2020.

    More about this item

    NEP fields

    This paper has been announced in the following NEP Reports:

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:arx:papers:2209.07823. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: arXiv administrators (email available below). General contact details of provider: http://arxiv.org/ .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.