Skip to content

roq-trading/roq-python-samples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

roq-python-samples

Example projects demonstrating how to use Roq's Python bindings.

Operating Systems

  • Linux (x86-64, AArch64)
  • macOS (Arm64, x86-64)

Library/Package Dependencies

Installing

If you just want to install the project.

Stable Channel

conda install -y --channel https://roq-trading.com/conda/stable roq-python-samples

Unstable Channel

conda install -y --channel https://roq-trading.com/conda/unstable roq-python-samples

Prerequisites

If you want to build from source.

Install Roq's Python bindings

Stable Channel

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

Unstable Channel

conda install -y --channel https://roq-trading.com/conda/unstable roq-python

Third-party

Some examples use the @typedispatch decorator from the fastcore library

conda install -y fastcore

Building

If you want to build from source.

python setup.py clean --all && python -m pip install . -vvv

Using

Strategy

Demonstrates how to set up a gateway client

  • Implements the callback handlers
  • Sends requests using the dispatcher interface
python -m roq_samples.strategy ~/run/deribit.sock

FIX Session

Demonstrates how to set up a FIX client session

python -m roq_samples.fix_session \
    --sender_comp_id xxx \
    --target_comp_id yyy \
    --username foo \
    --password bar \
    --network_address $HOME/run/fix-bridge.sock

SBE Receiver

Demonstrates how to maintain market data from SBE incremental / snapshot multicast feeds

python -m roq_samples.sbe_receiver \
    --local_interface 192.168.188.66 \
    --multicast_snapshot_address 225.0.0.1 \
    --multicast_snapshot_port 1234 \
    --multicast_incremental_address 225.0.0.1 \
    --multicast_incremental_port 2345

License

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

Links