roq-samples

Samples demonstrating how to implement various features of algorithmic trading.

Operating Systems

  • Linux

Library/Package Dependencies

Optional

Prerequisites

The project is designed to be compatible with the conda package manager.

wget -N https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh

bash Miniconda3-latest-Linux-x86_64.sh -b -u -p ~/miniconda3

source ~/miniconda3/bin/activate

conda install -y \
    git \
    cmake \
    gxx_linux-64

conda install -y --channel https://roq-trading.com/conda/stable \
    roq-client

Building

git submodule update --init --recursive

cmake .

make -j4

Using

  • Example 1
    • Connect to market gateway
    • Subscribe using regex patterns
  • Example 2
    • Manage disconnect
    • Process incremental market data update
    • Maintain a market depth view
    • Update a simple model
  • Example 3
    • Maintain positions
    • Place limit orders
    • Deal with order acks and updates
    • Historical simulation
    • Live trading
  • Example 4
    • Subscribe and nothing else

Simulation Data (install)

Simulation requires you to either use your own event logs (automatically captured when you're running a gateway) or use sample data

conda install -y --channel https://roq-trading.com/conda/stable \
    roq-data

Data can now be found in the $CONDA_PREFIX/share/roq/data/ directory.

Gateways (install, configure, run)

Deribit

conda install -y --channel https://roq-trading.com/conda/stable \
    roq-deribit

It is easiest to start from a config file template

cp $CONDA_PREFIX/share/roq/deribit/config.toml ~/deribit.toml

Edit this file and update with your Deribit API credentials (link).

You should look for these lines and replace as appropriate

login = "YOUR_DERIBIT_LOGIN_GOES_HERE"
secret = "YOUR_DERIBIT_SECRET_GOES_HERE"

Launch the gateway

roq-deribit \
    --name "deribit" \
    --config-file ~/deribit.toml \
    --client-listen-address ~/deribit.sock

Coinbase Pro

conda install -y --channel https://roq-trading.com/conda/stable \
    roq-coinbase-pro

It is easiest to start from a config file template

cp $CONDA_PREFIX/share/roq/coinbase-pro/config.toml ~/coinbase-pro.toml

Edit this file and update with your Coinbase Pro API credentials (link).

You should look for these lines and replace as appropriate

login = "YOUR_COINBASE_PRO_API_KEY_GOES_HERE"
password = "YOUR_COINBASE_PRO_PASSPHRASE_GOES_HERE"
secret = "YOUR_COINBASE_PRO_SECRET_GOES_HERE"

Launch the gateway

roq-coinbase-pro \
    --name "coinbase-pro" \
    --config-file ~/coinbase-pro.toml \
    --client-listen-address ~/coinbase-pro.sock

License

The project is released under the terms of the BSD 3-Clause license.

Roq Samples

Samples demonstrating how to implement various features of algorithmic trading

Roq Samples Info

⭐ Stars 39
🔗 Homepage roq-trading.com
🔗 Source Code github.com
🕒 Last Update 8 months ago
🕒 Created 3 years ago
🐞 Open Issues 0
➗ Star-Issue Ratio Infinity
😎 Author roq-trading