GithubHelp home page GithubHelp logo

qmm-crypto's Introduction

HFT market making in pytorch and gym

Agent

DQN Agent Diagram

Environment State Space is consists of eight indicators:

  1. LOB levels rendered as stationary prices;
  2. cumulative notional value at each price level;
  3. imbalances for cumulative notionals;
  4. order inflow imbalances at LOB levels;
  5. the spread between the best bid and ask prices;
  6. custom price momentum indicator;
  7. custom trade flow imbalance indicator; and
  8. environmental reward signal.
  9. forecasted volatility.

Distance to midpoint

Distance $\xi$ is the difference from price $p$ at LOB level $i$ from midpoint $m$ at time $t$. $$ \xi_{t,i}^{bid,ask} = \frac{p_{t,i}^{bid, ask}} {m_t} - 1 $$

Cumulative Notional Value at Price Level

Cumulative sum $\chi$ is the sum of the product of price $p$ and quantity $q$ at LOB level $i$ at the time $t$ for both $bid$ and $ask$ sides. The LOB's first 15 price levels are extracted from $bid$ and $ask$ sides of the LOB, thus creating 30 values for this features. $$ \chi_{t,i}^{bid, ask} = \sum_{i=0}^{I-1} p_{bid, ask}^{t,i} \times q_{bid, ask}^{t,i}$$

Notional Imbalances

The order imbalances $\iota$ are represented by notional value and normalized to the scale [โˆ’1, 1]. Since there are 15 price levels included, there are 15 values for this feature. $$ \iota_{t,i} = \frac{\chi_{t,i}^{ask,q} - \chi_{t,i}^{bid, q}}{\chi_{t,i}^{ask,q} + \chi_{t,i}^{bid,q}} $$

Tools to use

  1. pytorch
  2. cryptofeed
  3. influxdb
  4. DQN
  5. Trading Gym

How to use

Train:

python experiments.py --training true

Testing

python experiments.py --training false

qmm-crypto's People

Contributors

kalam360 avatar

Stargazers

 avatar  avatar OdinLin avatar  avatar Wilson Wang avatar

Watchers

 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.