Skip to content

Commit

Permalink
prep for 2.1.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
jbaron committed Dec 9, 2023
1 parent e135e36 commit a16a03f
Show file tree
Hide file tree
Showing 24 changed files with 249 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dockerx.yml
Expand Up @@ -26,4 +26,4 @@ jobs:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: roboquant/jupyter:2.0.0,roboquant/jupyter:latest
tags: roboquant/jupyter:2.1.0,roboquant/jupyter:latest
3 changes: 2 additions & 1 deletion README.adoc
Expand Up @@ -55,7 +55,8 @@ These are the how-to notebooks that are included:
* crypto.ipynb — Shows the integration with many crypto exchanges using the XChange library
* strategies.ipynb — How to develop your own strategies
* policies.ipynb — How to develop a custom policy
* discord.ipynb — ow to develop a Discord bot
* discord.ipynb — How to develop a Discord bot
* optimization.ipynb — How to perform advanced back tests with optimization via hyperparameter search
* talib.ipynb — How to develop technical analysis strategies using the `TaLib` library
* ta4j.ipynb — How to develop technical analysis strategies using teh `Ta4j` library
* forex.ipynb — How to run back-tests for Forex trading
Expand Down
16 changes: 10 additions & 6 deletions bin/README.adoc
Expand Up @@ -14,9 +14,9 @@ You can start using _roboquant_ with Jupyter notebooks straight out-of-the-box b
docker run -p 8888:8888 roboquant/jupyter
----

Then open the url that appears in your terminal in your browser to try it out. The `./notebooks` directory contains several notebooks that provide an introduction into roboquant.
Then open the url that appears in your terminal in your browser to try it out. The `./notebooks` directory contains several notebooks that provide an introduction into _roboquant_.

For more details, see https://roboquant.org/tutorial/install.html
For more details, see also https://roboquant.org/tutorial/install.html

== Interactive Brokers only
If you also want to run the Interactive Brokers Notebook that is included, it is important to realize that the IBKR client running inside the notebook requires access to a (host) running instance of Trader Workstation or IB Gateway (recommended).
Expand All @@ -41,16 +41,20 @@ You can build the Docker image from the source:
./bin/dockerbuild.sh
----

The build script has been tested and used with Docker Desktop. By default, this script builds an image for both Intel and ARM64 (Apple Silicon) architectures using the new Docker builder `buildx`. See the `dockerbuild.sh` script if you didn't enable the new builder yet.
The build script has been tested and used with Docker Desktop.
This script builds an image for both `amd64` and `arm64` architectures using the Docker builder `buildx`.
Read the comments in the `dockerbuild.sh` script if you didn't enable this builder yet.

Please note the `dockerbuild.sh` script will also push the image to the Docker Hub repository. If you just want to test the docker build on your local machine, you can use the following script instead:
Please note the `dockerbuild.sh` script will also push the image to the Docker Hub repository.
If you just want to test the docker build on your local machine, you can use the following script instead:

[source,shell]
----
./bin/dockerbuild_singleplatform.sh
----

NOTE: currently, only shell scripts are provided to build and start notebooks. So if you're on Windows you either have to use WSL or run the commands in the shell script from the command line manually.
NOTE: Currently, only shell scripts are provided to build and start notebooks. So if you're on Windows, you either have to use WSL or run the commands in the shell script from the command line manually.

== MyBinder.org
In order to start _roboquant_ notebooks quickly on MyBinder.org, there is a `binder directory included with a `Dockerfile` that retrieves the latest image from Docker Hub. This avoids that MyBinder.org has to build the image from scratch that leads to prolonged startup times.
In order to start _roboquant_ notebooks quickly on MyBinder.org, there is a `binder directory included with a `Dockerfile` that retrieves the latest image from Docker Hub.
This avoids MyBinder.org having to build the image from scratch that would otherwise lead to prolonged startup times.
2 changes: 1 addition & 1 deletion bin/dockerbuild.sh
Expand Up @@ -11,4 +11,4 @@ rm -f notebooks/*.nbconvert.ipynb
jupyter nbconvert --clear-output --inplace notebooks/*.ipynb

# Build for AMD64 and ARM64 platforms
docker buildx build --platform linux/amd64,linux/arm64/v8 -t roboquant/jupyter:2.0.0 -t roboquant/jupyter:latest --push .
docker buildx build --platform linux/amd64,linux/arm64/v8 -t roboquant/jupyter:2.1.0 -t roboquant/jupyter:latest --push .
2 changes: 1 addition & 1 deletion bin/dockerbuild_singleplatform.sh
Expand Up @@ -5,4 +5,4 @@ rm -f notebooks/*.nbconvert.ipynb
jupyter nbconvert --clear-output --inplace notebooks/*.ipynb

# Build for the local architecture platform only
docker build -t roboquant/jupyter:2.0.0 -t roboquant/jupyter:latest .
docker build -t roboquant/jupyter:2.1.0 -t roboquant/jupyter:latest .
2 changes: 1 addition & 1 deletion bin/run_notebooks.sh
Expand Up @@ -5,7 +5,7 @@
rm -f notebooks/*.nbconvert.ipynb
rm -f notebooks/error.log

for notebook in preload backtest charts empty policies strategies talib ta4j basic forex dataframes
for notebook in preload backtest charts empty policies strategies talib ta4j basic forex dataframes optimization
do
echo "****** running $notebook ********" >> notebooks/error.log
jupyter nbconvert --to notebook --execute "./notebooks/$notebook.ipynb" 2>> notebooks/error.log
Expand Down
2 changes: 1 addition & 1 deletion binder/Dockerfile
@@ -1 +1 @@
FROM roboquant/jupyter:2.0.0
FROM roboquant/jupyter:2.1.0
4 changes: 2 additions & 2 deletions notebooks/alpaca.ipynb
Expand Up @@ -28,7 +28,7 @@
"metadata": {},
"outputs": [],
"source": [
"%use roboquant(version=2.0.0, modules=extra)\n",
"%use roboquant(version=2.1.0, modules=alpaca)\n",
"\n",
"import org.roboquant.alpaca.*\n",
"Welcome()"
Expand Down Expand Up @@ -302,7 +302,7 @@
"name": "kotlin",
"nbconvert_exporter": "",
"pygments_lexer": "kotlin",
"version": "1.8.20-Beta"
"version": "1.9.0"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion notebooks/backtest.ipynb
Expand Up @@ -19,7 +19,7 @@
"metadata": {},
"outputs": [],
"source": [
"%use roboquant(2.0.0)\n",
"%use roboquant(2.1.0)\n",
"Welcome()"
]
},
Expand Down
2 changes: 1 addition & 1 deletion notebooks/basic.ipynb
Expand Up @@ -16,7 +16,7 @@
"metadata": {},
"outputs": [],
"source": [
"%use roboquant(2.0.0)\n",
"%use roboquant(2.1.0)\n",
"Welcome()"
]
},
Expand Down
10 changes: 7 additions & 3 deletions notebooks/binance.ipynb
Expand Up @@ -28,7 +28,7 @@
"metadata": {},
"outputs": [],
"source": [
"%use roboquant(version=2.0.0, modules=binance)\n",
"%use roboquant(version=2.1.0, modules=binance)\n",
"\n",
"// import binance package\n",
"import org.roboquant.binance.*\n",
Expand Down Expand Up @@ -300,7 +300,11 @@
"# Binance Paper Trading\n",
"This is still very much work in progress and is currently not available. However the goal is that once released, you can also place and manage orders on Binance using roboquant. Instead of the ```SimBroker``` used in the above examples, you only need to specify ```BinanceBroker``` and you will be able to do paper- and live trading. \n",
"\n",
"There is already some ground work done, so have a look at the roboquant source code if you want to see what is already there and perhaps contribute some code."
"There is already some ground work done, so have a look at the roboquant-binance source code if you want to see what is already there and perhaps contribute some code.\n",
"\n",
"<div class=\"alert alert-block alert-danger\">\n",
"Help is required to finish this implementation since Binance no longer operates in The Netherlands, where most of roboquant development is done. So only anonymous functionality, like retrieving market data can be accessed and tested without additional help.\n",
"</div>"
]
},
{
Expand All @@ -324,7 +328,7 @@
"name": "kotlin",
"nbconvert_exporter": "",
"pygments_lexer": "kotlin",
"version": "1.8.20"
"version": "1.9.0"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion notebooks/charts.ipynb
Expand Up @@ -23,7 +23,7 @@
},
"outputs": [],
"source": [
"%use roboquant(2.0.0)\n",
"%use roboquant(2.1.0)\n",
"Welcome()"
]
},
Expand Down
5 changes: 3 additions & 2 deletions notebooks/dataframes.ipynb
Expand Up @@ -28,7 +28,7 @@
"dataFrameConfig.display.rowsLimit = 20\n",
"dataFrameConfig.display.nestedRowsLimit = 4\n",
"\n",
"%use roboquant(2.0.0)"
"%use roboquant(2.1.0)"
]
},
{
Expand Down Expand Up @@ -126,7 +126,8 @@
"metadata": {},
"outputs": [],
"source": [
"df.describe(\"run-0\")"
"val run = roboquant.logger.getRuns().first()\n",
"df.describe(run)"
]
}
],
Expand Down
11 changes: 5 additions & 6 deletions notebooks/discord.ipynb
Expand Up @@ -5,11 +5,11 @@
"metadata": {},
"source": [
"# Introduction\n",
"This notebook shows how to develop a Discord bot that will publish signals generated by a strategy to a Discord channel. This notebooks assumes you already have created a token that allows the bot to publish messages to the channel.\n",
"This notebook shows how to develop a Discord bot that will publish signals generated by a strategy to a Discord channel. This notebook assumes you already have created a token that allows the bot to publish messages to the channel.\n",
"\n",
"The library used to integrate with Discord is `JDA`. It is a feature rich library and this notebook only shows the basics of what is possible. For more info visit https://github.com/DV8FromTheWorld/JDA.\n",
"\n",
"WARNING: a bot can quickly generate many messages and flood a message channel. So be very careful when experimenting with this notebook using existing message channels. "
"WARNING: a bot can quickly generate many messages and flood a Discord channel. So be very careful when experimenting with this notebook using existing message channels. "
]
},
{
Expand All @@ -25,10 +25,10 @@
},
"outputs": [],
"source": [
"%use roboquant(version=2.0.0, modules=crypto)\n",
"%use roboquant(version=2.1.0, modules=crypto)\n",
"\n",
"// Load the JDA library and import the required classes\n",
"@file:DependsOn(\"net.dv8tion:JDA:5.0.0-beta.4\")\n",
"@file:DependsOn(\"net.dv8tion:JDA:5.0.0-beta.13\")\n",
"import net.dv8tion.jda.api.*\n",
"import net.dv8tion.jda.api.entities.MessageEmbed\n",
"import net.dv8tion.jda.api.entities.channel.middleman.MessageChannel\n",
Expand Down Expand Up @@ -124,8 +124,7 @@
"outputs": [],
"source": [
"class DiscordPolicy(private val bot: DiscordBot) : FlexPolicy() {\n",
"\n",
"\n",
" \n",
" override fun act(signals: List<Signal>, account: Account, event: Event): List<Order> {\n",
" for (signal in signals) bot.publish(signal, event.time)\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/empty.ipynb
Expand Up @@ -16,7 +16,7 @@
"metadata": {},
"outputs": [],
"source": [
"%use roboquant(2.0.0)\n",
"%use roboquant(2.1.0)\n",
"Welcome()"
]
},
Expand Down
4 changes: 2 additions & 2 deletions notebooks/forex.ipynb
Expand Up @@ -16,7 +16,7 @@
},
"outputs": [],
"source": [
"%use roboquant(2.0.0)\n",
"%use roboquant(2.1.0)\n",
"Welcome()"
]
},
Expand Down Expand Up @@ -74,7 +74,7 @@
" }\n",
"\n",
" /**\n",
" * We want to create brack orders\n",
" * We create bracket orders\n",
" */\n",
" override fun createOrder(signal: Signal, size: Size, priceAction: PriceAction): Order? {\n",
" val price = priceAction.getPrice(config.priceType)\n",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/ibkr.ipynb
Expand Up @@ -58,7 +58,7 @@
"metadata": {},
"outputs": [],
"source": [
"%use roboquant(version=2.0.0, modules=ibkr)\n",
"%use roboquant(version=2.1.0, modules=ibkr)\n",
"import org.roboquant.ibkr.*\n",
"Welcome()"
]
Expand Down

0 comments on commit a16a03f

Please sign in to comment.