Skip to content

Commit

Permalink
Updated notebooks to use version 1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Dekkers committed May 29, 2023
1 parent 716372b commit 7a5481f
Show file tree
Hide file tree
Showing 18 changed files with 62 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Expand Up @@ -15,7 +15,7 @@ USER 1000

# Install the Kotlin kernel in the Jupyter environment
# RUN pip install kotlin-jupyter-kernel==0.11.0.255
RUN pip install -i https://test.pypi.org/simple/ kotlin-jupyter-kernel==0.11.0.359
RUN pip install -i https://test.pypi.org/simple/ kotlin-jupyter-kernel==0.11.0.393

# Make additional Kotlin kernels available with different memory profiles
RUN python -m kotlin_kernel add-kernel --name "Small_0.5GB" --jvm-arg=-Xmx512M
Expand Down
2 changes: 1 addition & 1 deletion notebooks/alpaca.ipynb
Expand Up @@ -28,7 +28,7 @@
"metadata": {},
"outputs": [],
"source": [
"%use roboquant(version=1.5.0-SNAPSHOT, modules=extra)\n",
"%use roboquant(version=1.5.0, modules=extra)\n",
"\n",
"import org.roboquant.alpaca.*\n",
"Welcome()"
Expand Down
2 changes: 1 addition & 1 deletion notebooks/backtest.ipynb
Expand Up @@ -19,7 +19,7 @@
"metadata": {},
"outputs": [],
"source": [
"%use roboquant(1.5.0-SNAPSHOT)\n",
"%use roboquant(1.5.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(1.5.0-SNAPSHOT)\n",
"%use roboquant(1.5.0)\n",
"Welcome()"
]
},
Expand Down
2 changes: 1 addition & 1 deletion notebooks/binance.ipynb
Expand Up @@ -28,7 +28,7 @@
"metadata": {},
"outputs": [],
"source": [
"%use roboquant(version=1.5.0-SNAPSHOT, modules=crypto)\n",
"%use roboquant(version=1.5.0, modules=crypto)\n",
"\n",
"// import binance package\n",
"import org.roboquant.binance.*\n",
Expand Down
49 changes: 45 additions & 4 deletions notebooks/charts.ipynb
Expand Up @@ -23,7 +23,7 @@
},
"outputs": [],
"source": [
"%use roboquant(1.5.0-SNAPSHOT)\n",
"%use roboquant(1.5.0)\n",
"Welcome()"
]
},
Expand Down Expand Up @@ -148,12 +148,54 @@
"PriceCorrelationChart(feed, assets)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Indicators\n",
"To get further insights into the price behavior of assets, you can use indicators. You can define your own, use one of the prebuilt ones like the `rsi` indicator in the example below."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"val rsi = TaLibIndicator.rsi(10)\n",
"val apple = feed.assets.getBySymbol(\"AAPL\")\n",
"val tesla = feed.assets.getBySymbol(\"TSLA\")\n",
"val data1 = feed.apply(apple, rsi)\n",
"val data2 = feed.apply(tesla, rsi)\n",
"MetricChart(data1 + data2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Strategy & Signals\n",
"\n",
"Before running a back-test, you might want to validate the type of signals that your strategy is producing. You can do so, using the SignalChart. This chart plots the signals and the rating (value from -2 to 2) over time.\n",
"For this notebook we'll use the EMA crossover strategy with its default settings"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"val strategy = EMAStrategy()\n",
"SignalChart(feed, strategy)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Account\n",
"We run a simple strategy over the feed we just created to get some results to use for the charts. For this notebook we use the EMA crossover strategy with its default settings and capture the AccountMetric metrics. After the run has finished, the account contains the latest state. There are several charts that provide some insights into this. "
"We run a simple strategy over the feed we just created to get some results to use for the charts. We'll also capture the AccountMetric metrics. After the run has finished, the account contains the latest state. There are several charts that provide some insights into this. "
]
},
{
Expand All @@ -164,8 +206,7 @@
},
"outputs": [],
"source": [
"val strategy = EMAStrategy()\n",
"val roboquant = Roboquant(strategy, AccountMetric())\n",
"val roboquant = Roboquant(strategy, AccountMetric())\n",
"roboquant.run(feed)"
]
},
Expand Down
2 changes: 1 addition & 1 deletion notebooks/crypto.ipynb
Expand Up @@ -16,7 +16,7 @@
"metadata": {},
"outputs": [],
"source": [
"%use roboquant(version=1.5.0-SNAPSHOT, modules=crypto)\n",
"%use roboquant(version=1.5.0, modules=crypto)\n",
"\n",
"import org.roboquant.xchange.*\n",
"Welcome()"
Expand Down
2 changes: 1 addition & 1 deletion notebooks/dataframes.ipynb
Expand Up @@ -28,7 +28,7 @@
"dataFrameConfig.display.rowsLimit = 20\n",
"dataFrameConfig.display.nestedRowsLimit = 4\n",
"\n",
"%use roboquant(1.5.0-SNAPSHOT)"
"%use roboquant(1.5.0)"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion notebooks/discord.ipynb
Expand Up @@ -25,7 +25,7 @@
},
"outputs": [],
"source": [
"%use roboquant(version=1.5.0-SNAPSHOT, modules=crypto)\n",
"%use roboquant(version=1.5.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",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/empty.ipynb
Expand Up @@ -16,7 +16,7 @@
"metadata": {},
"outputs": [],
"source": [
"%use roboquant(1.5.0-SNAPSHOT)\n",
"%use roboquant(1.5.0)\n",
"Welcome()"
]
},
Expand Down
2 changes: 1 addition & 1 deletion notebooks/forex.ipynb
Expand Up @@ -16,7 +16,7 @@
},
"outputs": [],
"source": [
"%use roboquant(1.5.0-SNAPSHOT)\n",
"%use roboquant(1.5.0)\n",
"Welcome()"
]
},
Expand Down
2 changes: 1 addition & 1 deletion notebooks/ibkr.ipynb
Expand Up @@ -58,7 +58,7 @@
"metadata": {},
"outputs": [],
"source": [
"%use roboquant(version=1.5.0-SNAPSHOT, modules=ibkr)\n",
"%use roboquant(version=1.5.0, modules=ibkr)\n",
"import org.roboquant.ibkr.*\n",
"Welcome()"
]
Expand Down
2 changes: 1 addition & 1 deletion notebooks/policies.ipynb
Expand Up @@ -17,7 +17,7 @@
"metadata": {},
"outputs": [],
"source": [
"%use roboquant(1.5.0-SNAPSHOT)\n",
"%use roboquant(1.5.0)\n",
"Welcome()"
]
},
Expand Down
2 changes: 1 addition & 1 deletion notebooks/preload.ipynb
Expand Up @@ -15,7 +15,7 @@
"metadata": {},
"outputs": [],
"source": [
"%use roboquant(version=1.5.0-SNAPSHOT, modules=extra:crypto:ibkr)"
"%use roboquant(version=1.5.0, modules=extra:crypto:ibkr)"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion notebooks/strategies.ipynb
Expand Up @@ -25,7 +25,7 @@
"metadata": {},
"outputs": [],
"source": [
"%use roboquant(1.5.0-SNAPSHOT)\n",
"%use roboquant(1.5.0)\n",
"Welcome()"
]
},
Expand Down
2 changes: 1 addition & 1 deletion notebooks/ta4j.ipynb
Expand Up @@ -15,7 +15,7 @@
"metadata": {},
"outputs": [],
"source": [
"%use roboquant(1.5.0-SNAPSHOT)\n",
"%use roboquant(1.5.0)\n",
"Welcome()"
]
},
Expand Down
2 changes: 1 addition & 1 deletion notebooks/talib.ipynb
Expand Up @@ -15,7 +15,7 @@
"metadata": {},
"outputs": [],
"source": [
"%use roboquant(1.5.0-SNAPSHOT)\n",
"%use roboquant(1.5.0)\n",
"Welcome()"
]
},
Expand Down
2 changes: 1 addition & 1 deletion notebooks/xgboost.ipynb
Expand Up @@ -19,7 +19,7 @@
"metadata": {},
"outputs": [],
"source": [
"%use roboquant(1.5.0-SNAPSHOT)\n",
"%use roboquant(1.5.0)\n",
"Welcome()"
]
},
Expand Down

0 comments on commit 7a5481f

Please sign in to comment.