Low-latency algorithmic trading platform written in Rust
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
backtester Updated FXCM Native Data Downloader + created basis of FXCM Flatfile … Feb 24, 2017
broker_shims Worked to get building on OSX to work Aug 23, 2017
configurator Worked to get building on OSX to work Aug 23, 2017
data Started the process of connecting the new data downloaders to the MM Mar 18, 2017
data_downloaders Updated some broken code Apr 15, 2017
logger Started the process of connecting the new data downloaders to the MM Mar 18, 2017
mm-react Worked to get building on OSX to work Aug 23, 2017
mm Shut Github up about vulnerable dependency May 12, 2018
optimizer Added some other actions to the fuzzer Feb 2, 2017
private Work on integrating the Poloniex Data Downloader Mar 18, 2017
scripts Converted balance to buying power in simbroker Feb 6, 2017
spawner Work on modernization and dependency updating Aug 1, 2017
tick_parser Added some other actions to the fuzzer Feb 2, 2017
tick_writer Added old scripts, Update MM, integrate postgres Sep 19, 2016
util Worked to get building on OSX to work Aug 23, 2017
.gitignore Got the main part of the Poloniex downloading process to CSV working Mar 18, 2017
License.txt Added MIT License Sep 22, 2016
Makefile Worked to get building on OSX to work Aug 23, 2017
README.md Moved the file logger logic into the util library + prepared for debu… Jan 30, 2017
THANKS.txt Finished up initial (untested) implementation of FXCM Flatfile Data D… Feb 24, 2017
dev.sh Created way to convert HashMaps into SimbrokerSettings Jan 12, 2017
gource-recent.sh Implemented functionality for loading documents from store Feb 24, 2017
gource.sh Implemented functionality for loading documents from store Feb 24, 2017
run.sh Got Poloniex historical data downloads working Mar 18, 2017

README.md

TickGrinder Algorithmic Trading Platform

Join the chat at https://gitter.im/TickGrinder/Lobby

TickGrinder is a high performance algorithmic trading platform written primarily in Rust. It is designed with the goal of efficiently processing event-based market data as quickly as possible in order to automatically place and manage trades.

Currently this platform is only compiles and runs on Linux-based systems. Windows functionality is planned for the future but no set schedule has been defined for its implementation.

Overview

The basis of the platform is written in Rust. It consists of several distinct modules that operate independently but communicate with each other via a custom messaging protocol implemented on top of Redis Pub/Sub. It is designed to be extensible and robust, capable of being used to trade any market consisting of event-based streaming Tick data.

Disclaimer: This platform is currently in active, early pre-alpha development and is in no way ready for any kind of trading. I do not take any responsibility for your trading actions using this platform nor any financial losses caused by errors in this application.

Tick Processors

The primary module is the Tick Processor. Multiple tick processors can be spawned, one for each symbol/data stream that is being processed by the platform. Their purpose is to convert live data into trading signals as quickly as possible.

Each time a tick arrives, a series of conditions are evaluated. These conditions can be anything: a SMA crossing a threshold, the current timestamp being greater than a certain number, any evaluable expression that you can program can serve as a condition. These conditions are designed to be dynamically set by the Optimizer module during trading operations.

Optimizer/Strategies

The Optimizer is a module that controls the conditions evaluated by the Tick Processors to open trades and interact with the broker API. Only one Optimizer is meant to run at once and it interacts with all Tick Processors that may be alive in the platform.

Optimizers, using whatever strategies you define, set the parameters and enable/disable trading conditions on the Tick Processors dynamically. They accomplish this by sending and receiving Commands to and from the Tick Processors, interacting with the database, or using any external data sources you may find useful. This application currently uses PostgreSQL as the main storage backend.

The strategies that are evaluated by the optimizer are meant to be written by you, the user! I'm keeping my strategies secret, but I will provide a sample strategy in the future for reference.

MM (Management/Monitoring) Interface

The MM is the interface between the platform and the user. It contains controls for manually managing platform components, monitoring bot activity, starting backtests, and pretty much everything else. It exists in the format of a simple NodeJS Express webserver and talks with the main communication system of the platform using a Websocket<->Redis bridge system.

It includes a custom charting module using Highcharts that can be extended with custom indicators to produce truly specialized charts for bot data. The configurations for these charts can be compiled down into JSON-encoded Macro strings which can then be loaded to instantly re-create charts with unique data sources and settings.

Broker APIs + Data Downloaders

Several scripts/utilities are included to interact with the FXCM Foreign Exchange API to create a live data feed and access historical market data. Using scripts located in the tick_writer and data_downloaders directories, this application can be controlled through Redis and used as a primary data source for the trading platform.

The data downloader script saves tick data for a currency pair into CSV files, downloading chunks of data automatically. The tick writer script does the same thing but processes live ticks sent over Redis instead. As I mentioned before, more detailed documentation can be found in the respective directories.

Installation

Requirements:

  • Rust/Cargo Nightly
  • NodeJS v5.0.0 or greater
  • Redis
  • PostgreSQL
  • libboost headers (sudo apt-get install libboost-all-dev)

After cloning the repository, you'll need to copy all instances of files named conf.default.rs, conf.sample.js, or anything similar to conf.js/rs in the same directory and fill out their values as appropriate.

After ensuring that you have a Redis and PostgreSQL server running and accessible to the program, you can make sure that everything is set up correctly by running make test in the root directory of the project. This will automatically pull down all needed dependencies, attempt to build all modules, and run all included tests. Any encountered errors will be printed to the console and you can use them to debug any issues you're having with the setup.

To use the live trading and data downloading functionalities, you'll need to set up the FXCM Java Application (located in the TickRecorder directory). Detailed setup and installation instructions for that are located in that folder. Documentation for the data downloader and tick_writer scripts can also be found in their respective directories.

Contributing

This is an open source project project, so you're more than welcome to fork it and customize it for your own needs.

As for contributing to master, I'm very happy to merge pull requests containing syntax improvements, bugfixes, or small stuff like that. However, for more significant things such as rewriting large segments of code or adding new features, please file an Issue or contact me privately before putting a lot of work in.

In addition, I will not accept any pull requests solely consisting of stylistic changes such as running files through rustfmt or linting the platform with Clippy. I'm aware that some of the choices in syntax and style I've used aren't 100% "rusty," but I made the choices I made for a reason. Things like fixing typos, adding in more clear or detailed comments/documentation, or re-implementing functions in a more concise or efficient method are very welcome, however.

Closing Remarks

If you've got any feedback or comments on the project, I'd love to hear it! I'm always working on developing my skills as a programmer, so any sage advice from seasoned veterans (or questions from eager beginners) are very welcome.

If you find this project useful, exciting, or have plans to use this in production, please let me know! I'd maybe be willing to work with you to make sure that your needs are met and improve the platform in the process.