Skip to content

nyarosu/hft

Repository files navigation


Logo

A high frequency trading system built with C++

A fast, high performance, low latency automated trading system built using C++, C and some x86 assembly.
Explore the docs »

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

Product Name Screen Shot A high performance, low latency high frequency trading system written in C++. Utilizes custom, lock free data structures, custom TCP networking lib, memory allocators, concurrency and several low latency techniques to execute a large amount of concurrent trades, each with a minimal amount of round trip latency. Built for Linux x86 systems only (some inline x86 ASM is used, and some POSIX system calls and APIs are used too). You can try to run it on WSL if you are on x86 Windows, but I've not tested this.

(back to top)

Built With

  • C++ (vast majority)
  • C (networking code and certain Linux system calls)
  • x86 assembly (certain inline portions)

(back to top)

Getting Started

Build with cmake, run tests with ctest to test if everything works. If all good, set env vars and run the binary.

Prerequisites

  • An x86 based, Linux system. The project will only build and run on this, as I mentioned before due to proprietary system calls and inline ASM. I will try to make this project more portable in the future if I can.
  • Trading account on TODO platform with either real funds or mock funds (todo how?)
  • cmake
    sudo apt-get install cmake
  • C++20 capable compiler (use GCC for maximal compatibility). This should be pre installed on Ubuntu, but if not, find the instructions to install it for your distro.

Installation

  1. TODO: steps on setting up a trading account and getting/setting API keys/credentials, haven't decided on a provider yet.
  2. Clone the repo
    git clone https://github.com/nyarosu/hft.git
  3. cd into the repository, then cd into extern.
 cd hft/extern
  1. Clone the vcpkg repository (package manager used by the project)
 git clone https://github.com/Microsoft/vcpkg.git
  1. Go back to the root repository and create a build directory
 cd .. && mkdir build
  1. Build with cmake (go into the new build directory, generate build files, then use build files to compile the project)
    cd build && cmake -S .. -B . && cmake --build .
  2. Run tests to make sure everything works (be inside build, after running the prior commands)
    ctest
  3. Start the trading system (from inside build)
    ./bin/HFT

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

About

High performance, low latency high frequency trading system written from scratch in C++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •