Git Product home page Git Product logo

rl_trading's Introduction

Building Trading Models Using Reinforcement Learning

This repository contains the framework built to my dissertation of the quantitative finance mastership program, from FGV University. I proposed the use of a learning algorithm and tile coding to develop an interest rate trading strategy directly from historical high-frequency order book data.

Example simulator

No assumption about market dynamics was made, but it has required the creation of this simulator wherewith the learning agent could interact to gain experience. You can check my master thesis here and the presentation here. Both are in Portuguese. The code structure is heavily inspired by Udacity's smartcab project and in OpenAi's Gym.

Install

This project requires Python 2.7 and the following Python libraries installed:

Run

In a terminal or command window, navigate to the top-level project directory rl_trading/ (that contains this README) and run the following command:

$ python -m market_sim.agent [-h] [-t] [-d] [-s] [-m] <OPTION>

Where OPTION is the kind of agent to be run. The flag [-t] is the number of trials to perform using the same file, [-d] is the date of the file to use in the simulation, [-m] is the month of the date flag and [-s] is the number of sessions on each trial. Use the flag [-h] to get information about what kind of agent is currently available, as well as other flags to use. The simulation will generate log files to be analyzed later on. Be aware that any of those simulations options might take several minutes to complete.

Data

An example of the datasets used in this project can be found here. Unzip it and include in the folder data/preprocessed.

Main References

  1. GOULD, M. D. et al. Limit order books. Quantitative Finance, 2013.
  2. CHAN, N. T.; SHELTON, C. An electronic market-maker. 2001.
  3. BUSONIU, L. et al. Reinforcement learning and dynamic programming using function approximators. CRC press, 2010.
  4. SUTTON, R. S.; BARTO, A. G. Reinforcement Learning: An Introduction, draft, in progress. 2st. MIT Press, 2017.

License

The contents of this repository are covered under the Apache 2.0 License.

rl_trading's People

Contributors

ucaiado avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.