Code Monkey home page Code Monkey logo

kissdesty / hftframework Goto Github PK

View Code? Open in Web Editor NEW

This project forked from javifalces/hftframework

0.0 0.0 0.0 285.6 MB

Market making algorithmic trading framework used to test reinforcement learning on " A reinforcement learning approach to improve the performance of the Avellaneda-Stoikov market-making algorithm "

License: Apache License 2.0

Shell 0.01% Python 0.20% C 0.02% Java 1.51% PowerShell 0.01% Batchfile 0.02% Jupyter Notebook 91.54% HLSL 0.01% MQL4 0.76% MQL5 5.95%

hftframework's Introduction

HFT Framework

Java / Python Framework used in my research,it can be connected to live markets using zeroMQ using the same code as in backtesting, Backtesting is a L2 backtest simulating orderbook changes and market trades.Some Latencies can be simulated. Data for backtesting should be in parquets like in data folder and has to be configured by the environment or application properties.

Framework and algorithms are all in the java code but backtest can be called from python and different tools and utilities from python can be used on the backtest results , like parameter tuning or plot the pnl and parameters.

Market connectors can have a persistance layer to save market data in parquets that can be used in backtesting. Open to suggestions/changes/modifications

Tutorial Backtest

Best example is found on jupyter notebook ConstantSpread example.

On this example we are running from notebook a backtest for the

This code is part of a bigger private repository with more algos and more connectors. If you see something wrong or is not compiling , please contact me by email

Alpha AS

IS my research where and Avellaneda Stoikov market making implementation is going to be manage by RL. RL is going to configure the different Avellaneda stoikov parameters dinamically based on market state.

Alpha AS

Avellaneda Stoikov implementation

[JAVA]

Where the algorithm logics , backtest and execution happens [JAVA 11 required]

Backtest Architecture

Live Architecture

Install

first install maven modules

  1. parent_pom
  2. common
  3. algorithmic_trading_framework
  4. trading_algorithms
  5. backtest_engine
  6. executables

then package executables -> Backtest.jar Backtest.jar is going to be our python launcher to get backtest results

Grateful for the libraries directly used

Environment settings

  • LAMBDA_PARQUET_TICK_DB= Folder where the parquets DB is saved
  • LAMBDA_DATA_PATH = Old Folder where the DB was saved
  • LAMBDA_OUTPUT_PATH = base path where the ml models will be saved
  • LAMBDA_INPUT_PATH = base path where the configuration of algorithms will be read automatically, soon

BACKTEST JAVA

  • LAMBDA_OUTPUT_PATH = output of java algorithms must be the same as applicaiton.properties
  • LAMBDA_TEMP_PATH = temp of java algorithms must be the same as applicaiton.properties
  • LAMBDA_JAR_PATH = path of the backtest jar path to run from python
  • LAMBDA_LOGS_PATH = where we are going to save the java logs

[PYTHON]

To get backtest results compare , optimize parameters -> Algo trading strategies are just and enumeration.Business logic must be in java compile and package java first! Grateful for the libraries directly used

  • mlfinlab
  • Pandas
  • Numpy
  • seaborn
  • Darwinex-ticks
  • dwx-zeromq-connector
  • ...etc

hftframework's People

Contributors

javifalces 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.