From 10a11009de1740a439d5ca45ae848d499976c1e8 Mon Sep 17 00:00:00 2001 From: Miha Kralj Date: Sat, 8 Apr 2023 11:59:40 -0700 Subject: [PATCH 1/2] Updated .gitignore, moved LICENSE to root --- .gitignore | 1 + docs/LICENSE => LICENSE | 0 docs/Trading_example.ipynb | 161 ++++++++++++++++++++++++++----------- 3 files changed, 116 insertions(+), 46 deletions(-) rename docs/LICENSE => LICENSE (100%) diff --git a/.gitignore b/.gitignore index c964a4a3..9413e591 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ *.userosscache *.sln.docstates .vscode/ +.fleet/ *.deps.json .Sandbox/ #.sonarlint/ diff --git a/docs/LICENSE b/LICENSE similarity index 100% rename from docs/LICENSE rename to LICENSE diff --git a/docs/Trading_example.ipynb b/docs/Trading_example.ipynb index 0178351b..020d62b0 100644 --- a/docs/Trading_example.ipynb +++ b/docs/Trading_example.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 18, + "execution_count": 46, "metadata": { "dotnet_interactive": { "language": "csharp" @@ -12,7 +12,7 @@ { "data": { "text/html": [ - "
Installed Packages
  • QuanTAlib, 0.2.0
" + "
Installed Packages
  • QuanTAlib, 0.2.1
" ] }, "metadata": {}, @@ -31,7 +31,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 47, "metadata": { "dotnet_interactive": { "language": "csharp" @@ -44,26 +44,26 @@ { "data": { "text/html": [ - "
" ] @@ -87,7 +87,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 48, "metadata": { "dotnet_interactive": { "language": "csharp" @@ -97,26 +97,26 @@ { "data": { "text/html": [ - "
" ] @@ -139,7 +139,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 49, "metadata": { "dotnet_interactive": { "language": "csharp" @@ -152,26 +152,26 @@ { "data": { "text/html": [ - "
" ] @@ -194,7 +194,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 50, "metadata": { "dotnet_interactive": { "language": "csharp" @@ -207,26 +207,26 @@ { "data": { "text/html": [ - "
" ] @@ -247,7 +247,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 51, "metadata": { "dotnet_interactive": { "language": "csharp" @@ -260,26 +260,26 @@ { "data": { "text/html": [ - "
" ] @@ -302,7 +302,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 52, "metadata": { "dotnet_interactive": { "language": "csharp" @@ -315,26 +315,26 @@ { "data": { "text/html": [ - "
" ] @@ -348,9 +348,78 @@ "\n", "//make a chart\n", "var cbars = Chart2D.Chart.Area(folio.t.Skip(warmup).ToList(), folio.v.Skip(warmup).ToList(),false ).WithSize(1200,400).WithMargin(Margin.init(30,10,40,30,1,false))\n", - " .WithXAxisRangeSlider(RangeSlider.init(Visible:false)).WithTitle($\"Trading P&L (long only) for MACD-generated trades on {symbol}\");\n", + " .WithXAxisRangeSlider(RangeSlider.init(Visible:false)).WithTitle($\"Equity curve (long trades only) for MACD on {symbol}\");\n", "cbars" ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": { + "dotnet_interactive": { + "language": "csharp" + }, + "polyglot_notebook": { + "kernelName": "csharp" + } + }, + "outputs": [ + { + "data": { + "text/html": [ + "
107.93999999999998
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "// some what-if examples\n", + "string symbol=\"IBM\";\n", + "int warmup = 50;\n", + "Yahoo_Feed bars = new(symbol,350);\n", + "TSeries data = bars.Close;\n", + "HEMA_Series fastMA = new(data,12);\n", + "JMA_Series slowMA = new(data,23,-100);\n", + "SUB_Series MACD_line = new(fastMA, slowMA);\n", + "JMA_Series signal_line = new(MACD_line, 9);\n", + "SUB_Series histogram = new(MACD_line, signal_line);\n", + "CROSS_Series trades = new(histogram,0);\n", + "EQUITY_Series folio = new(trades, data, Long:true, Short:false, Warmup:warmup);\n", + "folio[^1].v" + ] } ], "metadata": { From be6bf1b7ec78e17234b8889d30d65e129905f913 Mon Sep 17 00:00:00 2001 From: Miha Kralj Date: Sat, 8 Apr 2023 11:59:40 -0700 Subject: [PATCH 2/2] Update main automation workflow to exclude dev branch --- .github/workflows/main_automation.yml | 2 +- .gitignore | 1 + docs/LICENSE => LICENSE | 0 docs/Trading_example.ipynb | 161 ++++++++++++++++++-------- 4 files changed, 117 insertions(+), 47 deletions(-) rename docs/LICENSE => LICENSE (100%) diff --git a/.github/workflows/main_automation.yml b/.github/workflows/main_automation.yml index f7a9577b..5f1efe28 100644 --- a/.github/workflows/main_automation.yml +++ b/.github/workflows/main_automation.yml @@ -77,7 +77,7 @@ jobs: /d:sonar.cs.dotcover.reportsPaths=./coveragereport.html - name: Build Main branch of QuanTAlib DLL - if: ${{ github.ref == 'refs/heads/main' }} + if: ${{ github.ref != 'refs/heads/dev' }} run: dotnet build ./Calculations/Calculations.csproj --verbosity detailed --configuration Release --nologo -p:PackageVersion=${{ steps.gitversion.outputs.MajorMinorPatch }} - name: Build dev branch of QuanTAlib DLL diff --git a/.gitignore b/.gitignore index c964a4a3..9413e591 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ *.userosscache *.sln.docstates .vscode/ +.fleet/ *.deps.json .Sandbox/ #.sonarlint/ diff --git a/docs/LICENSE b/LICENSE similarity index 100% rename from docs/LICENSE rename to LICENSE diff --git a/docs/Trading_example.ipynb b/docs/Trading_example.ipynb index 0178351b..020d62b0 100644 --- a/docs/Trading_example.ipynb +++ b/docs/Trading_example.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 18, + "execution_count": 46, "metadata": { "dotnet_interactive": { "language": "csharp" @@ -12,7 +12,7 @@ { "data": { "text/html": [ - "
Installed Packages
  • QuanTAlib, 0.2.0
" + "
Installed Packages
  • QuanTAlib, 0.2.1
" ] }, "metadata": {}, @@ -31,7 +31,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 47, "metadata": { "dotnet_interactive": { "language": "csharp" @@ -44,26 +44,26 @@ { "data": { "text/html": [ - "
" ] @@ -87,7 +87,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 48, "metadata": { "dotnet_interactive": { "language": "csharp" @@ -97,26 +97,26 @@ { "data": { "text/html": [ - "
" ] @@ -139,7 +139,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 49, "metadata": { "dotnet_interactive": { "language": "csharp" @@ -152,26 +152,26 @@ { "data": { "text/html": [ - "
" ] @@ -194,7 +194,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 50, "metadata": { "dotnet_interactive": { "language": "csharp" @@ -207,26 +207,26 @@ { "data": { "text/html": [ - "
" ] @@ -247,7 +247,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 51, "metadata": { "dotnet_interactive": { "language": "csharp" @@ -260,26 +260,26 @@ { "data": { "text/html": [ - "
" ] @@ -302,7 +302,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 52, "metadata": { "dotnet_interactive": { "language": "csharp" @@ -315,26 +315,26 @@ { "data": { "text/html": [ - "
" ] @@ -348,9 +348,78 @@ "\n", "//make a chart\n", "var cbars = Chart2D.Chart.Area(folio.t.Skip(warmup).ToList(), folio.v.Skip(warmup).ToList(),false ).WithSize(1200,400).WithMargin(Margin.init(30,10,40,30,1,false))\n", - " .WithXAxisRangeSlider(RangeSlider.init(Visible:false)).WithTitle($\"Trading P&L (long only) for MACD-generated trades on {symbol}\");\n", + " .WithXAxisRangeSlider(RangeSlider.init(Visible:false)).WithTitle($\"Equity curve (long trades only) for MACD on {symbol}\");\n", "cbars" ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": { + "dotnet_interactive": { + "language": "csharp" + }, + "polyglot_notebook": { + "kernelName": "csharp" + } + }, + "outputs": [ + { + "data": { + "text/html": [ + "
107.93999999999998
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "// some what-if examples\n", + "string symbol=\"IBM\";\n", + "int warmup = 50;\n", + "Yahoo_Feed bars = new(symbol,350);\n", + "TSeries data = bars.Close;\n", + "HEMA_Series fastMA = new(data,12);\n", + "JMA_Series slowMA = new(data,23,-100);\n", + "SUB_Series MACD_line = new(fastMA, slowMA);\n", + "JMA_Series signal_line = new(MACD_line, 9);\n", + "SUB_Series histogram = new(MACD_line, signal_line);\n", + "CROSS_Series trades = new(histogram,0);\n", + "EQUITY_Series folio = new(trades, data, Long:true, Short:false, Warmup:warmup);\n", + "folio[^1].v" + ] } ], "metadata": {