neurallayer / roboquant

Roboquant is a fast, flexible, user-friendly and completely free algorithmic trading platform
https://www.roboquant.org
Apache License 2.0
323 stars 42 forks source link
algo-trading automated-trading backtesting cryptocurrency high-performance jupyter-notebook kotlin machine-learning trading trading-bot trading-strategies

// suppress inspection "Annotator" for whole file image::/docs/roboquant_header.png[roboquant Logo, align="center", link="https://roboquant.org"]

:icons: font

ifdef::env-github[] :tip-caption: :bulb: :note-caption: :information_source: :important-caption: :heavy_exclamation_mark: :caution-caption: :fire: :warning-caption: :warning: endif::[]

image:https://img.shields.io/badge/kotlin-1.9-blue.svg?logo=kotlin[Kotlin,link=http://kotlinlang.org] image:https://github.com/neurallayer/roboquant/actions/workflows/maven.yml/badge.svg[Automated Build,link=https://github.com/neurallayer/roboquant/actions/workflows/maven.yml] image:https://img.shields.io/github/languages/code-size/neurallayer/roboquant[GitHub code size] image:https://img.shields.io/badge/license-Apache%202-blue.svg[APL v2,link=http://www.apache.org/licenses/LICENSE-2.0.html] image:https://img.shields.io/github/issues/neurallayer/roboquant/bug?color=red&label=bugs[Bugs, link=https://github.com/neurallayer/roboquant/issues?q=is%3Aissue+is%3Aopen+label%3Abug] image:https://img.shields.io/github/issues/neurallayer/roboquant/enhancement?color=yellow&label=enhancements[Enhancements, link=https://github.com/neurallayer/roboquant/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement] image:https://img.shields.io/github/last-commit/neurallayer/roboquant[GitHub last commit] image:https://img.shields.io/github/commit-activity/m/neurallayer/roboquant[GitHub commit activity, link=https://github.com/neurallayer/roboquant/graphs/commit-activity] image:https://img.shields.io/github/v/tag/neurallayer/roboquant[GitHub tag (latest by date)] image:https://img.shields.io/maven-central/v/org.roboquant/roboquant?color=blue&[Maven Central, link=https://central.sonatype.com/artifact/org.roboquant/roboquant/1.3.0/versions] image:https://img.shields.io/nexus/s/org.roboquant/roboquant?server=https%3A%2F%2Fs01.oss.sonatype.org[Sonatype Nexus (Snapshots)] image:https://sonarcloud.io/api/project_badges/measure?project=neurallayer_roboquant&metric=alert_status[Quality Gate Status, link=https://sonarcloud.io/summary/new_code?id=neurallayer_roboquant] image:https://sonarcloud.io/api/project_badges/measure?project=neurallayer_roboquant&metric=security_rating[Security Rating, link=https://sonarcloud.io/component_measures?metric=new_security_rating&view=list&id=neurallayer_roboquant] image:https://sonarcloud.io/api/project_badges/measure?project=neurallayer_roboquant&metric=sqale_rating[Maintainability Rating, link=https://sonarcloud.io/component_measures?id=neurallayer_roboquant&metric=new_maintainability_rating&view=list]

Roboquant is an algorithmic trading platform that is lightning fast and flexible while at the same time strives to be developer friendly. It is fully open source, written in Kotlin, and can be used in Jupyter Notebooks as well as standalone applications.

It is designed to be used by anyone serious about algo trading, from beginning retail traders to established trading firms. You can find out more at https://roboquant.org[roboquant.org].

Please consider giving this repository a star ⭐ if you like the project.

== Code sample To demonstrate how easy it is to get started, the following code snippet shows all the ingredients required to back-test a trading strategy:

[source,kotlin]

val strategy = EMACrossover() // <1> val feed = CSVFeed("data/US") // <2> val account = run(feed, strategy) // <3> println(account.equity) // <4>

<1> Create the strategy that you want to validate <2> What data should be used, in this case, CSV files <3> Run the back test <4> Print the equity at the end of the run You can find out more at the online https://roboquant.org/tutorial/index.html[tutorial^]. == Installation === Library You can develop our own trading application in your favourite IDE using _roboquant_ as a library. image:/docs/idea_screenshot.png[IntelliJ IDEA] Just add roboquant and optional any of the additional modules as a dependency to your build tool, like Maven or Gradle. ==== Maven Add the following dependency to your `pom.xml` file: [source,xml] ---- org.roboquant roboquant VERSION ---- Or if you want to create your own new algo-trading project from scratch, you can run the Maven Archetype: [source,shell] ---- mvn archetype:generate \ -DarchetypeGroupId=org.roboquant \ -DarchetypeArtifactId=roboquant-quickstart \ -DarchetypeVersion=2.0.0 \ -DgroupId=org.mydomain \ -DartifactId=myapp \ -Dversion=1.0-SNAPSHOT ---- ==== Gradle Add the following line to your gradle script: [source,groovy] ---- implementation group: 'org.roboquant', name: 'roboquant', version: 'VERSION' ---- See also link:/docs/INSTALL.adoc[installation guide] for more ways to install and use _roboquant_. Latest available versions: - Regular version: image:https://img.shields.io/maven-central/v/org.roboquant/roboquant?color=blue&[Maven Central] - Snapshot version: image:https://img.shields.io/nexus/s/org.roboquant/roboquant?server=https%3A%2F%2Fs01.oss.sonatype.org[Sonatype Nexus (Snapshots)] === Jupyter Notebooks You can interactively develop your own strategies using a Jupyter Notebook. image:/docs/jupyter_screenshot.png[Jupyter Lab] If you just want to try it out without any installation, go to image:https://mybinder.org/badge_logo.svg[Binder,link=https://mybinder.org/v2/gh/neurallayer/roboquant-notebook/main?urlpath=lab/tree/notebooks/,window=_blank] If you already have Docker installed, all it takes is a single command to have a fully functional Jupyter Notebook environment available on your local machine. This image also comes with several example notebooks included. [source,shell] ---- docker run -p 8888:8888 roboquant/jupyter ---- == Features Some key features of _roboquant_ are: * [x] Blazingly fast back-testing, even on large volumes of historical data * [x] Easy to develop your own strategies and integrate with third party brokers and data providers * [x] Trade in multiple asset classes at the same time * [x] Run anything from a technical indicator to complex machine-learning based strategies * [x] Transition from back-testing to live trading with minimal changes * [x] Trade on multi-markets with multi-currencies * [x] Developed under open source with a permissive Apache license * [x] Use Jupyter Notebooks with insightful charts if you prefer interactive development * [x] Batteries included, for example, 150+ technical indicators and ready to use datasets * [x] Out of the box integration with Alpaca, Interactive Brokers, Alpha Vantage, Polygon, ECB, Binance and most other crypto exchanges See also https://roboquant.org/background/features.html[Features] for a more extensive feature list and how roboquant compares to some other platforms. == License Roboquant is distributed under the link:/LICENSE[Apache 2.0 License]. The Apache 2.0 license is a permissive license, meaning there are few restrictions on the use of the code. == Related projects The following list includes projects that extend the behavior of roboquant in some ways: - Support for trading using the Bybit broker and feeds: https://github.com/alleyway/roboquant-bybit - Support for a Maven archetype: https://github.com/neurallayer/roboquant-quickstart - Several sample notebooks and a docker container: https://github.com/neurallayer/roboquant-notebook == Thanks Besides all the link:docs/THIRDPARTY.adoc[great opensource software] that is powering _roboquant_, also special thanks to JetBrains for making a https://www.jetbrains.com/community/opensource/[license] available for *IntelliJ IDEA*. image:https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.png[JetBrains,100,100] == Disclaimer _Roboquant_ also comes with live trading capabilities. Using this is at your own risk, and there are *NO GUARANTEES* about the correct functioning of the software. PR are more than welcome, see also the link:/docs/CONTRIBUTING.adoc[Contribution Guide] document. If you're missing some features, you can also open an issue on GitHub. See also the link:/docs/TODO.adoc[todo documentation] for already identified backlog items if you look for something to work on.