HFTFramework  by javifalces

High-frequency trading framework for research

Created 3 years ago
253 stars

Top 99.4% on SourcePulse

GitHubView on GitHub
Project Summary

This repository provides a High-Frequency Trading (HFT) framework for research, specifically supporting the paper "A reinforcement learning approach to improve the performance of the Avellaneda-Stoikov market-making algorithm." It enables researchers to develop and backtest trading algorithms using L2 tick data with a unified codebase for both backtesting and live trading, interfacing with markets via Java and Python connectors.

How It Works

The framework utilizes a modular architecture with Connectors for market interfacing, supporting both in-process and remote (ZeroMQ) integration. A key feature is its L2 tick data backtesting capability, which mirrors the live trading environment's codebase. This allows for granular analysis and strategy validation. The system supports various market engines, including XChangeEngine for cryptocurrency exchanges and MetatraderEngine for forex, with the latter requiring a ZeroMQ gateway.

Quick Start & Requirements

  • Installation: Compile Java modules (Backtest, AlgoTradingZeroMq) to generate JAR files. Set environment variables LAMBDA_JAR_PATH and LAMBDA_ZEROMQ_JAR_PATH to point to these JARs. Prepare data in Parquet format and set LAMBDA_DATA_PATH.
  • Prerequisites: Java, Python, ZeroMQ, XChange library, Metatrader 5 (for MetatraderEngine with provided EA), Pandas, NumPy, Stable-baselines3, Ray.
  • Setup: Requires compilation of Java projects and configuration of environment variables and application properties.
  • Documentation: Links to ALGORITHM_DOCUMENTATION.md, BACKTEST_DOCUMENTATION.md, and MARKET_MAKING_ALGORITHMS_DOCUMENTATION.md are provided.

Highlighted Details

  • Supports backtesting at the L2 tick data level using the same codebase as live trading.
  • Includes connectors for cryptocurrency (XChange) and forex (Metatrader via ZeroMQ).
  • Research is based on a reinforcement learning approach to enhance the Avellaneda-Stoikov market-making algorithm.
  • The framework is primarily for research and has not been validated in a live trading environment.

Maintenance & Community

The project welcomes feedback, suggestions, and modifications. A TODO list includes reducing live latency, adding Ray support for RL, more exchange connectors, algorithms, tests, and documentation.

Licensing & Compatibility

The repository does not explicitly state a license. Compatibility for commercial use or closed-source linking is not specified.

Limitations & Caveats

The framework has not been validated in a live trading environment and should be used with caution. The research paper notes that the RL models exhibited localized excessive risk-taking, leading to occasional heavy drawdowns.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
2
Star History
6 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.