Features

The 4 main objectives

Roboquant has 4 main objectives that determine most of its features: Fast, Flexible, Friendly and Free. All the features listed on this page can be directly linked to one of these 4 objectives.

Fast

Nowadays, there is so much more data available than ever before. It would be a lost opportunity not being able to use this data to develop smarter and better performing strategies. Roboquant can work seamlessly with these large data-sets:

  • Use of multi-threading and coroutines to fully utilize modern hardware, like large multicore machines

  • Optimized and fine-tuned back-test engine so the engine itself will not become the bottleneck

  • Run multiple back-test in parallel

  • Very fast parallel CSV parsing, allowing to process directories full of CSV files in just seconds

  • Support for file formats like Apache Avro™ to further reduce parsing overhead and easily share data sets

  • Support for lazy loading of data, so memory doesn’t become a constraint

  • Several very fast algorithms out of the box

Performance Test

To give an idea what performance can be achieved on moderate hardware (Apple MacBook Pro, JDK 17): running a complete back test containing 1 million price-bars using an EMA-Crossover strategy takes less than 200 milliseconds.

You can easily reproduce it on your own hardware:

// Generate 1.008.000 1-minute price bars
val feed = RandomWalkFeed.lastDays(days = 7, nAssets = 100)

// Repeat three times to exclude compile time overhead of the first run
repeat(3) {
    val t = measureTimeMillis {
        val roboquant = Roboquant(EMAStrategy(), ProgressMetric(), logger = SilentLogger())
        roboquant.run(feed)
    }
    println("time = $t ms")
}

or if you have the roboquant source code installed, you can use the following maven command:

mvn test -Dtest=PerformanceTest -pl roboquant -DTEST_PERFORMANCE=true

The following table shows the order of magnitude that the different parts of the system has been optimized for:

Aspect Size Description

Assets

50k

the number of unique assets used in a run. For example every stock or option-contract is a unique asset

Open Positions

5k

the number of open positions during a run

Created Orders

100k

the number of orders created during a run

Trades

100k

the number of trades generated during a run

Cash currencies

50

the number of currencies in cash balances

Published Events

10M

the total number of events during a run

Actions

1B

the total number of actions (like candlesticks) used during a run

Exchanges

100

the number of exchanges defined

Flexible

Flexible means being able to trade at different markets at different parts in the world. This implies:

  • Support for trading assets in different currencies at the same time

  • Roboquant comes out of the box with ready to use currency converters

  • Correctly handles data from different time-zones

  • Trade traditional asset classes like stocks, options, futures and forex as well as cryptocurrencies

  • Support for simple trading strategies and advanced machine learning based approaches

  • Support for simple and advanced order types

Flexible also means roboquant is fully modular and can be extended:

  • Integrate with 3rd party brokers and exchanges

  • Add new types of data feeds ranging from price feeds and fundamental data to unstructured data like images

  • Support for custom order types

Friendly

Developing trading algorithms requires a lot of different skills. You need to know of course a lot about trading itself, but also programming and even a bit of statistics comes in handy. Roboquant tries to cater for both experienced and less experienced users and make it as user-friendly as possible without sacrificing the other objectives.

Trading specific Domain Model

Rather than having a generic framework where you still have to code a lot to make it usable, roboquant approach is that of a trading specific domain model. For example, you can easily work with monetary amounts:

val wallet = 100.EUR + 20.USD + 1_000.JPY
wallet.convert(USD)

Interactive Development

Roboquant can be run inside a Jupyter Notebook which makes it easy to explore and experiment different ideas. Any code you developed in the notebook, you can at a later stage be used in a standalone application if you want to move to live trading.

A lot of effort went into designing an API that is easy to use from a Notebook and add features that make sense in the context of algo-trading:

  • Many charts out of the box that provides insights into the feeds and the results of a run

  • Graceful introduction of complexity.In other words: simple things should be simple, complex things should be possible

  • Many convenience methods to get results with minimal amount of coding

  • Sensible defaults for many arguments, so you don’t have to specify them all the time

Another example, if you want to plot a chart, you don’t first have to mangle data to make it consumable by the chart. In roboquant the charts understand the key domain concepts like Account, Trades and Metrics and can plot these directly.

val account = broker.account
TradeChart(account.trades)

Once you code base grows too large for a notebook, the same code can be used in a traditional IDE.

Order Management

One of the hardest (and most overlooked) aspect of algorithmic trading is order management, especially when your goal is to come to a robust live trading environment. There are many things that potentially can go wrong and will cost you real money. It is a real endeavor to translate signals into actual orders and manage these outstanding orders.

Because of this, roboquant separates the generation of signals (Strategy) from the actual orders (Policy). This allows algo-traders to focus on the generation of signals and pick the order management that fits their risk profile and trading style. And if full control over position- and order-management is required, it is still available.

Batteries included

  • Over 150 technical indicators that are easy to use in your own strategies

  • Powerful charts when running back-tests in a Jupyter Notebook

  • Support for many back-testing approaches, like for walk-forwards and random samples

  • Pluggable metrics you can use to see how a strategy is performing

  • An advanced simulated broker for back-testing and live-testing that can handle both basic and advanced order types

  • Integration with 3rd party brokers and data providers

Free

In order to build the best platform for algo-trading possible, we think it is important to make sure this platform is free for anyone to use, contribute and improve upon. That is why roboquant is developed under the permissive Apache 2.0 license and welcomes people to contribute.

But it doesn’t stop at the software. For real progress also data has to become freely available so performance of various strategies can be more easily compared. This is still very much work in progress, but for sure on the agenda of roboquant.

Deep Learning Datasets

For inspiration, look at what quality training data did for progress of AI in recent years. By having standardized sets of data that are known to be of good quality and representative, it became much easier to compare different network architectures and continue to improve those that showed the best performance.

The same can hopefully also be achieved in the algo-trading world, so we can easily compare strategies and reproduce results.

Feature Comparison

The following table provide a short overview of how the features of roboquant stack up to some alternative algo-trading frameworks.

Of course, we are not completely objective, so we recommend trying them out for yourself and see which one suits you best.

Feature roboquant Backtrader Zipline Lean (QuantConnect)

Back Testing

Live Testing

Paper Trading

Live Trading

Primary Language

Kotlin

Python

Python

C#

License

Apache

GPL

Apache

Apache

Active Development

Multi Currency

Crypto Exchanges

Advanced Order Types

Multi Region

Performance

high

low

low

mid

Code base

small

small

medium

large

Jupyter Notebook

Completely Free