Roboquant Documentation

repository·main·Indexed 19 days ago

https://github.com/neurallayer/roboquant

An open-source, high-performance algorithmic trading platform written in Kotlin for back-testing and live-trading strategies across multiple asset classes. It features a developer-friendly API, 150+ technical indicators, and specialized modules for integrations with Alpaca, Interactive Brokers (IBKR), QuestDB, Apache Avro, and Kotlin Jupyter Notebooks. The platform includes core components for feeds, strategies, policies, brokers, and metrics, with support for technical analysis libraries like TaLib and Ta4j.

Tokens
10.9K
Snippets
33
Records
55
Agent score
66%

What's inside Roboquant

  1. Overview of Roboquant features

    main

    Roboquant is a fast and flexible algorithmic trading platform designed for both retail traders and professional firms. Key capabilities include:

    • High Performance: Fast back-testing on large historical datasets.
    • Extensibility: Easy integration of custom strategies, third-party brokers, and data providers.
    • Multi-Asset/Multi-Market: Support for multiple asset classes, markets, and currencies simultaneously.
    • Strategy Variety: Supports everything from simple technical indicators to complex machine-learning models.
    • Live Trading: Designed to transition from back-testing to live trading with minimal code changes.
    • Batteries Included: Includes 150+ technical indicators, ready-to-use datasets, and out-of-the-box integration with Alpaca, Interactive Brokers, the ECB, and various CSV providers.
  2. Use technical analysis in strategies with roboquant-ta

    main

    The roboquant-ta module provides integration with popular technical analysis libraries to simplify the creation of strategies, metrics, and indicators that rely on technical indicators.

    It provides built-in support for:

    • TaLib: A widely used technical analysis library.
    • Ta4j: A Java library for technical analysis.

    You can use the classes provided in the org.roboquant.ta package to incorporate these indicators into your roboquant workflows with minimal boilerplate code.

  3. Core components of the roboquant module

    main

    The roboquant module provides the core framework for creating and running trading strategies. It is organized into several key functional areas:

    • Feeds (org.roboquant.feeds): Sources of information (price data) for back-testing and live trading.
    • Strategies (org.roboquant.strategies): The core logic implementing the Strategy interface.
    • Policies (org.roboquant.policies): Logic that converts signals into orders.
    • Brokers (org.roboquant.brokers): Interfaces for executing trades. The core module includes SimBroker for back-testing simulations.
    • Metrics (org.roboquant.metrics): Tools to monitor and evaluate strategy performance.

    Note: This module does not include third-party integrations. For specific data providers or live brokers (e.g., Alpaca), use specialized modules like roboquant-alpaca.

  4. Use QuestDB for feed and metrics logging in roboquant

    main
    The roboquant-questdb module provides implementations for feed and metrislogger that use QuestDB as the underlying storage engine. This allows you to record and play back market data feeds and log performance metrics directly into a QuestDB database for high-performance time-series analysis.
  5. How policies and strategies interact

    main

    In the roboquant framework, trading logic is split between strategies and policies:

    1. Strategies (org.roboquant.strategies): Implement the Strategy interface to define the high-level trading logic.
    2. Policies (org.roboquant.policies): Act as the decision-making layer that receives zero or more signals and generates orders based on those signals.
  6. Available data feeds in org.roboquant.feeds

    main

    The org.roboquant.feeds package provides several built-in data sources for back-testing and simulation:

    • csv: Reads historical price data from CSV files.
    • random walk: Simulates price movements using a random walk model.
    • test: Uses a predefined set of prices for testing purposes.

    For integration with external brokers or specific data providers, refer to specialized roboquant-... modules.

  7. IBKR implementations in org.roboquant.ibkr

    main

    The org.roboquant.ibkr package provides Interactive Brokers-specific implementations for the following core Roboquant components:

    • Broker: Handles order execution and account management via IBKR.
    • Historic Feeds: Provides access to historical market data from IBKR.
    • Live Feeds: Provides real-time market data streams from IBKR.
    • Exchange Rates: Provides currency exchange rate data from IBKR.
  8. Simulating trades with SimBroker in org.roboquant.brokers

    main

    The org.roboquant.brokers package defines the Broker interface. The core module provides the SimBroker implementation, which is used to simulate broker behavior during back-tests.

    To use live brokers or paper trading, you must use specialized modules (e.g., roboquant-alpaca) instead of the core SimBroker.

  9. Record and play feeds using org.roboquant.avro

    main

    The org.roboquant.avro package contains the core classes required to handle Apache Avro-based data streams. Use these classes to:

    1. Record feeds: Capture incoming data and persist it to an Apache Avro file.
    2. Play feeds: Read data from an existing Apache Avro file to simulate a feed during backtesting or playback.