Compare commits
359 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2963936695 | ||
|
|
d81f57b7a6 | ||
|
|
88c7f7ff3b | ||
|
|
2e2136f7b8 | ||
|
|
f8b258d329 | ||
|
|
4411d4a8fc | ||
|
|
99affdebef | ||
|
|
8fa1f3659c | ||
|
|
005bebe224 | ||
|
|
1df11c0c64 | ||
|
|
fff037b9c9 | ||
|
|
2959581d19 | ||
|
|
2232861c64 | ||
|
|
33eb9dec9b | ||
|
|
07fbbe65bb | ||
|
|
6e854550aa | ||
|
|
93086b06db | ||
|
|
b86f001f8a | ||
|
|
844602c04a | ||
|
|
1a5a08175b | ||
|
|
cbccb6e5cf | ||
|
|
78a9b80bbf | ||
|
|
a0914e2ab1 | ||
|
|
fb3409d8a2 | ||
|
|
b4bad69772 | ||
|
|
b29e009d4d | ||
|
|
28eb1a4da4 | ||
|
|
2a1539cce6 | ||
|
|
b08fc979cf | ||
|
|
2128630389 | ||
|
|
6d35bfd3bc | ||
|
|
d12772d8eb | ||
|
|
3db538d690 | ||
|
|
1c85ab164f | ||
|
|
d9923929b9 | ||
|
|
39f5f55b17 | ||
|
|
a6c5448bb2 | ||
|
|
0e182ae75f | ||
|
|
621d16eea8 | ||
|
|
fbad58161b | ||
|
|
8a243059b0 | ||
|
|
d276d6382d | ||
|
|
489fc5bd5f | ||
|
|
fb489daa3e | ||
|
|
7e27ab74bb | ||
|
|
f93c9edfcb | ||
|
|
60a69cbf1d | ||
|
|
eccd1e7931 | ||
|
|
90a6d2f68f | ||
|
|
372c197890 | ||
|
|
f0c253c50b | ||
|
|
76c0ab01ee | ||
|
|
e47b4e63ab | ||
|
|
f70cf97dee | ||
|
|
b9f3b1a4a4 | ||
|
|
1645f9877e | ||
|
|
52c6d43d2e | ||
|
|
04fc0d5093 | ||
|
|
56164f636a | ||
|
|
dc64a340ba | ||
|
|
8e0e823f66 | ||
|
|
18e848853d | ||
|
|
038d7a26b2 | ||
|
|
4ca5526461 | ||
|
|
d9e4dba687 | ||
|
|
5f2bae1de5 | ||
|
|
e065c752cc | ||
|
|
bc34c33c77 | ||
|
|
8f1dc76c7f | ||
|
|
505ea3bd72 | ||
|
|
eecafbea09 | ||
|
|
0b47c84b8a | ||
|
|
4c3658f9d4 | ||
|
|
d8c58fb9e2 | ||
|
|
1fd0dd3566 | ||
|
|
6109ac8f1b | ||
|
|
aae4771b7e | ||
|
|
76b19161cb | ||
|
|
6e9df75d32 | ||
|
|
aae3f8b4d9 | ||
|
|
04bb2b503f | ||
|
|
df13e34e9e | ||
|
|
4976fc9a99 | ||
|
|
aa1ebd0e65 | ||
|
|
d1b8c13318 | ||
|
|
a139aac522 | ||
|
|
3338486b52 | ||
|
|
0c0eedf547 | ||
|
|
e8c1b0df48 | ||
|
|
ed1362c8b0 | ||
|
|
906ab20bee | ||
|
|
10a9f31d65 | ||
|
|
0817101bcd | ||
|
|
3e9fc57bb0 | ||
|
|
e442586a0d | ||
|
|
adca9ea5b3 | ||
|
|
947a3fc93b | ||
|
|
b1b9680880 | ||
|
|
7aabea102b | ||
|
|
2522a14050 | ||
|
|
69eea5419c | ||
|
|
a6283b0ab7 | ||
|
|
2a941e73e2 | ||
|
|
1c3180b681 | ||
|
|
ffcfb4eeb2 | ||
|
|
e2ee42a0e2 | ||
|
|
026ba6ed5b | ||
|
|
3a3dbe29ea | ||
|
|
663d0ff094 | ||
|
|
bfca56c4a8 | ||
|
|
28fe8a1e7c | ||
|
|
492490e2c5 | ||
|
|
bfb820c617 | ||
|
|
bdfe9399da | ||
|
|
240e84dd3d | ||
|
|
62fb61929f | ||
|
|
72e7dca7af | ||
|
|
1ea0cd9d82 | ||
|
|
a099b9fb71 | ||
|
|
54413e99b4 | ||
|
|
03df6c5ccb | ||
|
|
329ce54ca9 | ||
|
|
2f21a27023 | ||
|
|
e562b8c99c | ||
|
|
f8b79b8d6b | ||
|
|
9dbeb3255d | ||
|
|
7e81693d3c | ||
|
|
bc05aa03f9 | ||
|
|
c75d0d8a6d | ||
|
|
4c9a455a08 | ||
|
|
f17a8e4d92 | ||
|
|
6ccafe9640 | ||
|
|
ddbc654d53 | ||
|
|
c86b005564 | ||
|
|
0303cf079f | ||
|
|
626f64e37d | ||
|
|
1ca007faa3 | ||
|
|
d39a9420d5 | ||
|
|
240d7db8e2 | ||
|
|
49b6c56fe8 | ||
|
|
af0de8d2e9 | ||
|
|
b47619e7b9 | ||
|
|
092dcda143 | ||
|
|
e029b96229 | ||
|
|
25d664e349 | ||
|
|
7952db992b | ||
|
|
936350cf45 | ||
|
|
d173c5d65e | ||
|
|
a02309f2c6 | ||
|
|
956428b7bf | ||
|
|
df935aa608 | ||
|
|
4fd58ce180 | ||
|
|
96b56f06d5 | ||
|
|
05ab723b63 | ||
|
|
14b256846d | ||
|
|
c4c66c2aba | ||
|
|
1996498af5 | ||
|
|
e22565c849 | ||
|
|
177531651c | ||
|
|
a309322ae5 | ||
|
|
5ddc8c3766 | ||
|
|
5d6110f38c | ||
|
|
eeb512fac6 | ||
|
|
2547af1ccc | ||
|
|
b21fcc98be | ||
|
|
60aba9efa4 | ||
|
|
94572f571c | ||
|
|
501dc01399 | ||
|
|
d1171500e3 | ||
|
|
d32bf13b4d | ||
|
|
4d55493000 | ||
|
|
24820fe92c | ||
|
|
73c71c6913 | ||
|
|
3c9f9aae20 | ||
|
|
ff47ede36c | ||
|
|
1a3138d0cd | ||
|
|
756a61b8e0 | ||
|
|
b479300587 | ||
|
|
d2d3cdcc0f | ||
|
|
bae69aaa0a | ||
|
|
ee3cea805e | ||
|
|
ad6046fea5 | ||
|
|
cc9a061cb1 | ||
|
|
90a2c06a4c | ||
|
|
615827f259 | ||
|
|
b64169fd20 | ||
|
|
cb0661c79e | ||
|
|
5d148683b7 | ||
|
|
0df6366301 | ||
|
|
bdcb6d9474 | ||
|
|
b14bda2dc0 | ||
|
|
1283f52de1 | ||
|
|
64d0eaefab | ||
|
|
e42d84319d | ||
|
|
cc73f5bca8 | ||
|
|
0ff3622d1e | ||
|
|
ef01980b07 | ||
|
|
82b3468ab7 | ||
|
|
bce3fb41bb | ||
|
|
7f6da62e5d | ||
|
|
9aa9f715ec | ||
|
|
c33ce2f8c3 | ||
|
|
383acc06d2 | ||
|
|
5c5201944a | ||
|
|
410956bf9f | ||
|
|
2147d868d8 | ||
|
|
1e70673e00 | ||
|
|
4823cca7ef | ||
|
|
46d5d46aca | ||
|
|
3712786301 | ||
|
|
97489dfc57 | ||
|
|
278401cfcf | ||
|
|
6e7b69da44 | ||
|
|
b5ced1635e | ||
|
|
f01ac9be3a | ||
|
|
2b045bfd35 | ||
|
|
96f8a89c0d | ||
|
|
da706dbd8e | ||
|
|
c5790f3e20 | ||
|
|
794835772a | ||
|
|
a043313004 | ||
|
|
c9dde8a0df | ||
|
|
5eb6026180 | ||
|
|
bbe2e31cb8 | ||
|
|
fd76171604 | ||
|
|
a1d5b1bd31 | ||
|
|
dba6a04196 | ||
|
|
014ec3453d | ||
|
|
0db0f10ee9 | ||
|
|
1a22f20340 | ||
|
|
5c078cd2a9 | ||
|
|
08e1f31271 | ||
|
|
7f15202dfc | ||
|
|
4e56af487c | ||
|
|
3bb390779b | ||
|
|
f12bcb39a6 | ||
|
|
17639c399d | ||
|
|
fbca273807 | ||
|
|
e838319a56 | ||
|
|
884bfe4482 | ||
|
|
416d38271b | ||
|
|
b657365da7 | ||
|
|
991ac4595f | ||
|
|
a7516b80ea | ||
|
|
8b2eb5bd68 | ||
|
|
6ce418ca5c | ||
|
|
c61b8da167 | ||
|
|
c8890c3da9 | ||
|
|
baf2dbcefa | ||
|
|
4d5e0fb73a | ||
|
|
3122edcaf9 | ||
|
|
1965a2868d | ||
|
|
3e86712c1a | ||
|
|
8943dc6535 | ||
|
|
c8a646c0f0 | ||
|
|
0b81cf0218 | ||
|
|
6b1f859f5a | ||
|
|
6fb9cf8521 | ||
|
|
0d6abf5dde | ||
|
|
6b7be767f5 | ||
|
|
3888896ed4 | ||
|
|
fb383dc73c | ||
|
|
5891f44312 | ||
|
|
841e6f12c2 | ||
|
|
afabedbfda | ||
|
|
02e54d0242 | ||
|
|
430b30b2ac | ||
|
|
c3cdeea0ee | ||
|
|
a4f2c03015 | ||
|
|
d1a2b95ddc | ||
|
|
f1076020af | ||
|
|
cd88806e93 | ||
|
|
b5087bf42a | ||
|
|
4ad0288110 | ||
|
|
35469154c4 | ||
|
|
9c893e83a2 | ||
|
|
8134b099fa | ||
|
|
8d54438eac | ||
|
|
b23bc870e2 | ||
|
|
9e51f10b77 | ||
|
|
ed92e6653b | ||
|
|
08a1f84f91 | ||
|
|
8e54918378 | ||
|
|
fcab09effb | ||
|
|
5436c72fad | ||
|
|
f152652f5b | ||
|
|
f9bbec1e16 | ||
|
|
20c92b0350 | ||
|
|
375af2ebd2 | ||
|
|
daae49cc4f | ||
|
|
227ade63ed | ||
|
|
9524f48a33 | ||
|
|
d977eb2181 | ||
|
|
e15614a18f | ||
|
|
2e20b4803d | ||
|
|
cb0c7b0814 | ||
|
|
645e1ca88c | ||
|
|
84bb72fddb | ||
|
|
4d32119576 | ||
|
|
c836c62945 | ||
|
|
2069833361 | ||
|
|
b46b50fa50 | ||
|
|
4d77431ae1 | ||
|
|
1bce9bcb71 | ||
|
|
2dc40f0477 | ||
|
|
403814d64f | ||
|
|
384ec3dbad | ||
|
|
708d38d4e5 | ||
|
|
03bc23ed8c | ||
|
|
73c26ee7ec | ||
|
|
ce33c393e6 | ||
|
|
279a306758 | ||
|
|
0247b95edd | ||
|
|
d47e073d90 | ||
|
|
6d75aee0ce | ||
|
|
bbbf6f3a74 | ||
|
|
3362a976fa | ||
|
|
f684940a7c | ||
|
|
9c92a67510 | ||
|
|
b401fde07e | ||
|
|
7db8df3f8d | ||
|
|
7feb46fec5 | ||
|
|
1c81f5d028 | ||
|
|
3b2e165254 | ||
|
|
44d1454ed7 | ||
|
|
a58f6b679d | ||
|
|
761ea2571a | ||
|
|
0b661e70c1 | ||
|
|
f1d55c3b0b | ||
|
|
497ac8497a | ||
|
|
1877d59daa | ||
|
|
56881e64fe | ||
|
|
52de357b27 | ||
|
|
70acb30546 | ||
|
|
7c68e3f37a | ||
|
|
8a087f2166 | ||
|
|
a9c88ad25c | ||
|
|
bc6ac5470b | ||
|
|
06bec5fb8e | ||
|
|
d6f894eb3b | ||
|
|
8ed5f69ea6 | ||
|
|
1c6be6438d | ||
|
|
2f03c92e30 | ||
|
|
069246dda5 | ||
|
|
fbf8ffd924 | ||
|
|
c6322956d9 | ||
|
|
aab5391d80 | ||
|
|
bbbab6d9a8 | ||
|
|
4c909f33b9 | ||
|
|
e07c6265df | ||
|
|
9069246519 | ||
|
|
0ed6d7e8b0 | ||
|
|
11c182ed16 | ||
|
|
a5586ba562 | ||
|
|
1393ce4c5d | ||
|
|
694ffbbb80 | ||
|
|
642fe96fde | ||
|
|
c4433098c3 | ||
|
|
38f5a9c60c |
@@ -24,7 +24,7 @@
|
||||
// "forwardPorts": [],
|
||||
|
||||
// Uncomment the next line to run commands after the container is created - for example installing curl.
|
||||
"postCreateCommand": "dotnet nuget add source /Lean/LocalPackages; dos2unix /Lean/.vscode/launch_research.sh",
|
||||
"postCreateCommand": "dotnet nuget add source /Lean/LocalPackages;chmod u+x /Lean/.vscode/launch_research.sh;dos2unix /Lean/.vscode/launch_research.sh",
|
||||
|
||||
// Add mounts to docker container
|
||||
"mounts": [
|
||||
|
||||
34
.github/workflows/gh-actions.yml
vendored
34
.github/workflows/gh-actions.yml
vendored
@@ -10,23 +10,21 @@ on:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-20.04
|
||||
container:
|
||||
image: quantconnect/lean:foundation
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Free space
|
||||
run: df -h && rm -rf /opt/hostedtoolcache* && df -h
|
||||
|
||||
- name: Build
|
||||
run: dotnet build /p:Configuration=Release /v:quiet /p:WarningLevel=1 QuantConnect.Lean.sln
|
||||
|
||||
- name: Run Tests
|
||||
run: dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --blame-hang-timeout 300seconds --blame-crash --filter "TestCategory!=TravisExclude&TestCategory!=ResearchRegressionTests" -- TestRunParameters.Parameter\(name=\"log-handler\", value=\"ConsoleErrorLogHandler\"\)
|
||||
|
||||
- name: Generate & Publish python stubs
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
run: |
|
||||
chmod +x ci_build_stubs.sh
|
||||
./ci_build_stubs.sh -t -g -p
|
||||
env:
|
||||
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
|
||||
ADDITIONAL_STUBS_REPOS: ${{ secrets.ADDITIONAL_STUBS_REPOS }}
|
||||
QC_GIT_TOKEN: ${{ secrets.QC_GIT_TOKEN }}
|
||||
- uses: addnab/docker-run-action@v3
|
||||
with:
|
||||
image: quantconnect/lean:foundation
|
||||
options: --workdir /__w/Lean/Lean -v /home/runner/work:/__w -e GITHUB_REF=${{ github.ref }} -e PYPI_API_TOKEN=${{ secrets.PYPI_API_TOKEN }} -e ADDITIONAL_STUBS_REPOS=${{ secrets.ADDITIONAL_STUBS_REPOS }} -e QC_GIT_TOKEN=${{ secrets.QC_GIT_TOKEN }}
|
||||
shell: bash
|
||||
run: |
|
||||
# Build
|
||||
dotnet build /p:Configuration=Release /v:quiet /p:WarningLevel=1 QuantConnect.Lean.sln && \
|
||||
# Run Tests
|
||||
dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --blame-hang-timeout 300seconds --blame-crash --filter "TestCategory!=TravisExclude&TestCategory!=ResearchRegressionTests" -- TestRunParameters.Parameter\(name=\"log-handler\", value=\"ConsoleErrorLogHandler\"\) && \
|
||||
# Generate & Publish python stubs
|
||||
echo "GITHUB_REF $GITHUB_REF" && if [[ $GITHUB_REF = refs/tags/* ]]; then (chmod +x ci_build_stubs.sh && ./ci_build_stubs.sh -t -g -p); else echo "Skipping stub generation"; fi
|
||||
22
.github/workflows/regression-tests.yml
vendored
22
.github/workflows/regression-tests.yml
vendored
@@ -10,13 +10,19 @@ on:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-20.04
|
||||
container:
|
||||
image: quantconnect/lean:foundation
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Free space
|
||||
run: df -h && rm -rf /opt/hostedtoolcache* && df -h
|
||||
|
||||
- name: Build
|
||||
run: dotnet build /p:Configuration=Release /v:quiet /p:WarningLevel=1 QuantConnect.Lean.sln
|
||||
|
||||
- name: Run Tests
|
||||
run: dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter TestCategory=RegressionTests -- TestRunParameters.Parameter\(name=\"log-handler\", value=\"ConsoleErrorLogHandler\"\) TestRunParameters.Parameter\(name=\"reduced-disk-size\", value=\"true\"\)
|
||||
- uses: addnab/docker-run-action@v3
|
||||
with:
|
||||
image: quantconnect/lean:foundation
|
||||
options: --workdir /__w/Lean/Lean -v /home/runner/work:/__w
|
||||
shell: bash
|
||||
run: |
|
||||
# Build
|
||||
dotnet build /p:Configuration=Release /v:quiet /p:WarningLevel=1 QuantConnect.Lean.sln
|
||||
# Run Tests
|
||||
dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter TestCategory=RegressionTests -- TestRunParameters.Parameter\(name=\"log-handler\", value=\"ConsoleErrorLogHandler\"\) TestRunParameters.Parameter\(name=\"reduced-disk-size\", value=\"true\"\)
|
||||
43
.github/workflows/research-regression-tests.yml
vendored
43
.github/workflows/research-regression-tests.yml
vendored
@@ -10,26 +10,27 @@ on:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-20.04
|
||||
container:
|
||||
image: quantconnect/lean:foundation
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Free space
|
||||
run: df -h && rm -rf /opt/hostedtoolcache* && df -h
|
||||
|
||||
- name: install dependencies
|
||||
run: |
|
||||
pip3 install papermill==2.4.0 clr-loader==0.1.6
|
||||
|
||||
- name: install kernel
|
||||
run: dotnet tool install --global Microsoft.dotnet-interactive --version 1.0.340501
|
||||
|
||||
- name: Add dotnet tools to Path
|
||||
run: echo "$HOME/.dotnet/tools" >> $GITHUB_PATH
|
||||
|
||||
- name: activate kernel for jupyter
|
||||
run: dotnet interactive jupyter install
|
||||
|
||||
- name: Build
|
||||
run: dotnet build /p:Configuration=Release /v:quiet /p:WarningLevel=1 QuantConnect.Lean.sln
|
||||
|
||||
- name: Run Tests
|
||||
run: dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter TestCategory=ResearchRegressionTests -- TestRunParameters.Parameter\(name=\"log-handler\", value=\"ConsoleErrorLogHandler\"\) TestRunParameters.Parameter\(name=\"reduced-disk-size\", value=\"true\"\)
|
||||
- uses: addnab/docker-run-action@v3
|
||||
with:
|
||||
image: quantconnect/lean:foundation
|
||||
options: --workdir /__w/Lean/Lean -v /home/runner/work:/__w
|
||||
shell: bash
|
||||
run: |
|
||||
# install dependencies
|
||||
pip3 install papermill==2.4.0 clr-loader==0.1.6
|
||||
# install kernel
|
||||
dotnet tool install --global Microsoft.dotnet-interactive --version 1.0.340501
|
||||
# Add dotnet tools to Path
|
||||
export PATH="$HOME/.dotnet/tools:$PATH"
|
||||
# activate kernel for jupyter
|
||||
dotnet interactive jupyter install
|
||||
# Build
|
||||
dotnet build /p:Configuration=Release /v:quiet /p:WarningLevel=1 QuantConnect.Lean.sln
|
||||
# Run Tests
|
||||
dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter TestCategory=ResearchRegressionTests -- TestRunParameters.Parameter\(name=\"log-handler\", value=\"ConsoleErrorLogHandler\"\) TestRunParameters.Parameter\(name=\"reduced-disk-size\", value=\"true\"\)
|
||||
|
||||
94
.github/workflows/virtual-environments.yml
vendored
94
.github/workflows/virtual-environments.yml
vendored
@@ -10,55 +10,49 @@ on:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-20.04
|
||||
container:
|
||||
image: quantconnect/lean:foundation
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Free space
|
||||
run: df -h && rm -rf /opt/hostedtoolcache* && df -h
|
||||
|
||||
- name: Build
|
||||
run: dotnet build /p:Configuration=Release /v:quiet /p:WarningLevel=1 QuantConnect.Lean.sln
|
||||
|
||||
- name: Python Virtual Environment System Packages
|
||||
run: python -m venv /lean-testenv --system-site-packages && . /lean-testenv/bin/activate && pip install --no-cache-dir lean==1.0.99 && deactivate
|
||||
|
||||
- name: Run Virtual Environment Test System Packages
|
||||
run: dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonVirtualEnvironmentTests.AssertVirtualEnvironment"
|
||||
|
||||
- name: Python Virtual Environment
|
||||
run: rm -rf /lean-testenv && python -m venv /lean-testenv && . /lean-testenv/bin/activate && pip install --no-cache-dir lean==1.0.99 && deactivate
|
||||
|
||||
- name: Run Virtual Environment Test
|
||||
run: dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonVirtualEnvironmentTests.AssertVirtualEnvironment"
|
||||
|
||||
- name: Run Python Package Tests
|
||||
run: dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests" --blame-hang-timeout 120seconds --blame-crash
|
||||
|
||||
- name: Run Pomegranate & Tigramite Python Package Test
|
||||
run: dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.PomegranateTest|Tigramite" --blame-hang-timeout 120seconds --blame-crash
|
||||
|
||||
- name: Run StableBaselines Python Package Test
|
||||
run: dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.StableBaselinesTest" --blame-hang-timeout 120seconds --blame-crash
|
||||
|
||||
- name: Run AxPlatform Python Package Test
|
||||
run: dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.AxPlatformTest" --blame-hang-timeout 120seconds --blame-crash
|
||||
|
||||
- name: Run NBeats Python Package Test
|
||||
run: dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.NBeatsTest" --blame-hang-timeout 120seconds --blame-crash
|
||||
|
||||
- name: Run TensorlyTest Python Package Test
|
||||
run: dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.TensorlyTest" --blame-hang-timeout 120seconds --blame-crash
|
||||
|
||||
- name: Run TensorflowProbability, NeuralTangents, Ignite Python Package Test
|
||||
run: dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.TensorflowProbabilityTest|TensorflowTest|NeuralTangentsTest|IgniteTest" --blame-hang-timeout 120seconds --blame-crash
|
||||
|
||||
- name: Run Hvplot Python Package Test
|
||||
run: dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.HvplotTest" --blame-hang-timeout 120seconds --blame-crash
|
||||
|
||||
- name: Run Hvplot Python Package Test
|
||||
run: dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.StellargraphTest" --blame-hang-timeout 120seconds --blame-crash
|
||||
|
||||
- name: Run Keras Python Package Test
|
||||
run: dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.KerasTest" --blame-hang-timeout 120seconds --blame-crash
|
||||
|
||||
- name: Run Keras Python Package Test
|
||||
run: dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.ScikerasTest" --blame-hang-timeout 120seconds --blame-crash
|
||||
- uses: addnab/docker-run-action@v3
|
||||
with:
|
||||
image: quantconnect/lean:foundation
|
||||
options: --workdir /__w/Lean/Lean -v /home/runner/work:/__w
|
||||
shell: bash
|
||||
run: |
|
||||
# Build
|
||||
dotnet build /p:Configuration=Release /v:quiet /p:WarningLevel=1 QuantConnect.Lean.sln
|
||||
# Python Virtual Environment System Packages
|
||||
python -m venv /lean-testenv --system-site-packages && . /lean-testenv/bin/activate && pip install --no-cache-dir lean==1.0.99 && deactivate
|
||||
# Run Virtual Environment Test System Packages
|
||||
dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonVirtualEnvironmentTests.AssertVirtualEnvironment"
|
||||
# Python Virtual Environment
|
||||
rm -rf /lean-testenv && python -m venv /lean-testenv && . /lean-testenv/bin/activate && pip install --no-cache-dir lean==1.0.99 && deactivate
|
||||
# Run Virtual Environment Test
|
||||
dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonVirtualEnvironmentTests.AssertVirtualEnvironment"
|
||||
# Run Python Package Tests
|
||||
dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests" --blame-hang-timeout 120seconds --blame-crash
|
||||
# Run StableBaselines Python Package Test
|
||||
dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.StableBaselinesTest" --blame-hang-timeout 120seconds --blame-crash
|
||||
# Run AxPlatform Python Package Test
|
||||
dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.AxPlatformTest" --blame-hang-timeout 120seconds --blame-crash
|
||||
# Run TensorlyTest Python Package Test
|
||||
dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.TensorlyTest" --blame-hang-timeout 120seconds --blame-crash
|
||||
# Run NeuralTangents, Ignite Python Package Test
|
||||
dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.NeuralTangentsTest|IgniteTest" --blame-hang-timeout 120seconds --blame-crash
|
||||
# Run TensorflowTest
|
||||
dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.TensorflowTest" --blame-hang-timeout 120seconds --blame-crash
|
||||
# Run TensorflowProbability
|
||||
dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.TensorflowProbabilityTest" --blame-hang-timeout 120seconds --blame-crash
|
||||
# Run Hvplot Python Package Test
|
||||
dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.HvplotTest" --blame-hang-timeout 120seconds --blame-crash
|
||||
# Run Stellargraph Python Package Test
|
||||
dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.StellargraphTest" --blame-hang-timeout 120seconds --blame-crash
|
||||
# Run Keras Python Package Test
|
||||
dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.KerasTest" --blame-hang-timeout 120seconds --blame-crash
|
||||
# Run Scikeras Python Package Test
|
||||
dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.ScikerasTest" --blame-hang-timeout 120seconds --blame-crash
|
||||
# Run Transformers
|
||||
dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.Transformers" --blame-hang-timeout 120seconds --blame-crash
|
||||
2
.vscode/readme.md
vendored
2
.vscode/readme.md
vendored
@@ -156,5 +156,5 @@ _Figure 2: Python Debugger Messages_
|
||||
Here we will cover some common issues with setting this up. This section will expand as we get user feedback!
|
||||
|
||||
- The "project file cannot be loaded" and "nuget packages not found" errors occurs when the project files are open by another process in the host. Closing all applications and/or restarting the computer solve the issue.
|
||||
- Autocomplete and reference finding with omnisharp can sometimes bug, if this occurs use the command palette to restart omnisharp. (Ctrl+Shift+P "OmniSharp: Restart OmniSharp")
|
||||
- Autocomplete and reference finding with omnisharp can sometimes be buggy, if this occurs use the command palette to restart omnisharp. (Ctrl+Shift+P "OmniSharp: Restart OmniSharp")
|
||||
- Any error messages about building in VSCode that point to comments in JSON. Either select **ignore** or follow steps described [here](https://stackoverflow.com/questions/47834825/in-vs-code-disable-error-comments-are-not-permitted-in-json) to remove the errors entirely.
|
||||
|
||||
@@ -91,40 +91,22 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "0.200%"},
|
||||
{"Expectancy", "-0.585"},
|
||||
{"Net Profit", "-0.172%"},
|
||||
{"Sharpe Ratio", "-10.169"},
|
||||
{"Sharpe Ratio", "-11.13"},
|
||||
{"Probabilistic Sharpe Ratio", "12.075%"},
|
||||
{"Loss Rate", "78%"},
|
||||
{"Win Rate", "22%"},
|
||||
{"Profit-Loss Ratio", "0.87"},
|
||||
{"Alpha", "-0.149"},
|
||||
{"Alpha", "-0.156"},
|
||||
{"Beta", "0.035"},
|
||||
{"Annual Standard Deviation", "0.008"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-9.603"},
|
||||
{"Tracking Error", "0.215"},
|
||||
{"Treynor Ratio", "-2.264"},
|
||||
{"Treynor Ratio", "-2.478"},
|
||||
{"Total Fees", "$199.00"},
|
||||
{"Estimated Strategy Capacity", "$26000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.002"},
|
||||
{"Kelly Criterion Estimate", "38.796"},
|
||||
{"Kelly Criterion Probability Value", "0.228"},
|
||||
{"Sortino Ratio", "-22.493"},
|
||||
{"Return Over Maximum Drawdown", "-77.93"},
|
||||
{"Portfolio Turnover", "1.211"},
|
||||
{"Total Insights Generated", "100"},
|
||||
{"Total Insights Closed", "99"},
|
||||
{"Total Insights Analysis Completed", "99"},
|
||||
{"Long Insight Count", "100"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$135639.1761"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$21852.9784"},
|
||||
{"Mean Population Estimated Insight Value", "$220.7372"},
|
||||
{"Mean Population Direction", "53.5354%"},
|
||||
{"Mean Population Magnitude", "53.5354%"},
|
||||
{"Rolling Averaged Population Direction", "58.2788%"},
|
||||
{"Rolling Averaged Population Magnitude", "58.2788%"},
|
||||
{"Portfolio Turnover", "119.89%"},
|
||||
{"OrderListHash", "3c4c4085810cc5ecdb927d3647b9bbf3"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -127,40 +127,22 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "1.700%"},
|
||||
{"Expectancy", "1.781"},
|
||||
{"Net Profit", "1.442%"},
|
||||
{"Sharpe Ratio", "4.86"},
|
||||
{"Sharpe Ratio", "4.836"},
|
||||
{"Probabilistic Sharpe Ratio", "59.497%"},
|
||||
{"Loss Rate", "33%"},
|
||||
{"Win Rate", "67%"},
|
||||
{"Profit-Loss Ratio", "3.17"},
|
||||
{"Alpha", "4.181"},
|
||||
{"Alpha", "4.164"},
|
||||
{"Beta", "-1.322"},
|
||||
{"Annual Standard Deviation", "0.321"},
|
||||
{"Annual Variance", "0.103"},
|
||||
{"Information Ratio", "-0.795"},
|
||||
{"Tracking Error", "0.532"},
|
||||
{"Treynor Ratio", "-1.18"},
|
||||
{"Treynor Ratio", "-1.174"},
|
||||
{"Total Fees", "$14.78"},
|
||||
{"Estimated Strategy Capacity", "$47000000.00"},
|
||||
{"Lowest Capacity Asset", "IBM R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.408"},
|
||||
{"Kelly Criterion Estimate", "16.559"},
|
||||
{"Kelly Criterion Probability Value", "0.316"},
|
||||
{"Sortino Ratio", "12.447"},
|
||||
{"Return Over Maximum Drawdown", "106.327"},
|
||||
{"Portfolio Turnover", "0.411"},
|
||||
{"Total Insights Generated", "3"},
|
||||
{"Total Insights Closed", "3"},
|
||||
{"Total Insights Analysis Completed", "3"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "3"},
|
||||
{"Long/Short Ratio", "0%"},
|
||||
{"Estimated Monthly Alpha Value", "$20784418.6104"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$3579538.7607"},
|
||||
{"Mean Population Estimated Insight Value", "$1193179.5869"},
|
||||
{"Mean Population Direction", "100%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "100%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "41.18%"},
|
||||
{"OrderListHash", "9da9afe1e9137638a55db1676adc2be1"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -119,25 +119,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", ""},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "79228162514264337593543950335"},
|
||||
{"Portfolio Turnover", "0"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "0%"},
|
||||
{"OrderListHash", "d41d8cd98f00b204e9800998ecf8427e"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -116,25 +116,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", ""},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "79228162514264337593543950335"},
|
||||
{"Portfolio Turnover", "0"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "0%"},
|
||||
{"OrderListHash", "d41d8cd98f00b204e9800998ecf8427e"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -121,40 +121,22 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "0.300%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0.289%"},
|
||||
{"Sharpe Ratio", "4.233"},
|
||||
{"Sharpe Ratio", "3.924"},
|
||||
{"Probabilistic Sharpe Ratio", "68.349%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "0.035"},
|
||||
{"Alpha", "0.028"},
|
||||
{"Beta", "0.122"},
|
||||
{"Annual Standard Deviation", "0.024"},
|
||||
{"Annual Variance", "0.001"},
|
||||
{"Information Ratio", "-3.181"},
|
||||
{"Tracking Error", "0.142"},
|
||||
{"Treynor Ratio", "0.842"},
|
||||
{"Treynor Ratio", "0.78"},
|
||||
{"Total Fees", "$1.00"},
|
||||
{"Estimated Strategy Capacity", "$35000000.00"},
|
||||
{"Lowest Capacity Asset", "IBM R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.022"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "8.508"},
|
||||
{"Return Over Maximum Drawdown", "58.894"},
|
||||
{"Portfolio Turnover", "0.022"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "1.51%"},
|
||||
{"OrderListHash", "bd88c6a0e10c7e146b05377205101a12"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -135,40 +135,22 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "0.000%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "-0.034%"},
|
||||
{"Sharpe Ratio", "-7.854"},
|
||||
{"Sharpe Ratio", "-10.666"},
|
||||
{"Probabilistic Sharpe Ratio", "1.216%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "-0.022"},
|
||||
{"Alpha", "-0.029"},
|
||||
{"Beta", "0.004"},
|
||||
{"Annual Standard Deviation", "0.003"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-0.768"},
|
||||
{"Tracking Error", "0.241"},
|
||||
{"Treynor Ratio", "-4.689"},
|
||||
{"Treynor Ratio", "-6.368"},
|
||||
{"Total Fees", "$8.60"},
|
||||
{"Estimated Strategy Capacity", "$5500000.00"},
|
||||
{"Lowest Capacity Asset", "ES VMKLFZIH2MTD"},
|
||||
{"Fitness Score", "0.417"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "-81.518"},
|
||||
{"Portfolio Turnover", "0.834"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "66.80%"},
|
||||
{"OrderListHash", "802a335b5c355e83b8cd2174f053c1b9"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -183,40 +183,22 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "1.000%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "5.333%"},
|
||||
{"Sharpe Ratio", "64.137"},
|
||||
{"Sharpe Ratio", "64.084"},
|
||||
{"Probabilistic Sharpe Ratio", "95.977%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "25.72"},
|
||||
{"Alpha", "25.763"},
|
||||
{"Beta", "2.914"},
|
||||
{"Annual Standard Deviation", "0.423"},
|
||||
{"Annual Variance", "0.179"},
|
||||
{"Information Ratio", "66.11"},
|
||||
{"Tracking Error", "0.403"},
|
||||
{"Treynor Ratio", "9.315"},
|
||||
{"Treynor Ratio", "9.308"},
|
||||
{"Total Fees", "$8.60"},
|
||||
{"Estimated Strategy Capacity", "$22000000.00"},
|
||||
{"Lowest Capacity Asset", "ES XFH59UK0MYO1"},
|
||||
{"Fitness Score", "1"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "79228162514264337593543950335"},
|
||||
{"Portfolio Turnover", "2.035"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "122.11%"},
|
||||
{"OrderListHash", "e7021bd385f366771ae00abd3a46a22e"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -112,12 +112,12 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "5.200%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "11.912%"},
|
||||
{"Sharpe Ratio", "1604181.92"},
|
||||
{"Sharpe Ratio", "1604181.904"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "2144881.34"},
|
||||
{"Alpha", "2144882.02"},
|
||||
{"Beta", "31.223"},
|
||||
{"Annual Standard Deviation", "1.337"},
|
||||
{"Annual Variance", "1.788"},
|
||||
@@ -127,25 +127,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Fees", "$35.70"},
|
||||
{"Estimated Strategy Capacity", "$2600000.00"},
|
||||
{"Lowest Capacity Asset", "ES 31C3JQS9D84PW|ES XCZJLC9NOB29"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "79228162514264337593543950335"},
|
||||
{"Portfolio Turnover", "0"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "495.15%"},
|
||||
{"OrderListHash", "64221a660525c4259d5bd852eef1299c"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 612882;
|
||||
public long DataPoints => 608372;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -239,40 +239,22 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "0.900%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "1.951%"},
|
||||
{"Sharpe Ratio", "15.548"},
|
||||
{"Sharpe Ratio", "15.402"},
|
||||
{"Probabilistic Sharpe Ratio", "95.977%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "1.885"},
|
||||
{"Alpha", "1.886"},
|
||||
{"Beta", "1.066"},
|
||||
{"Annual Standard Deviation", "0.155"},
|
||||
{"Annual Variance", "0.024"},
|
||||
{"Information Ratio", "13.528"},
|
||||
{"Tracking Error", "0.142"},
|
||||
{"Treynor Ratio", "2.258"},
|
||||
{"Treynor Ratio", "2.237"},
|
||||
{"Total Fees", "$3.57"},
|
||||
{"Estimated Strategy Capacity", "$760000.00"},
|
||||
{"Lowest Capacity Asset", "ES XCZJLDQX2SRO|ES XCZJLC9NOB29"},
|
||||
{"Fitness Score", "0.403"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "79228162514264337593543950335"},
|
||||
{"Portfolio Turnover", "0.403"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "32.31%"},
|
||||
{"OrderListHash", "738240babf741f1bf79f85ea5026ec4c"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -136,40 +136,22 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "0.300%"},
|
||||
{"Expectancy", "-0.042"},
|
||||
{"Net Profit", "-0.332%"},
|
||||
{"Sharpe Ratio", "-3.149"},
|
||||
{"Sharpe Ratio", "-4.614"},
|
||||
{"Probabilistic Sharpe Ratio", "0.427%"},
|
||||
{"Loss Rate", "50%"},
|
||||
{"Win Rate", "50%"},
|
||||
{"Profit-Loss Ratio", "0.92"},
|
||||
{"Alpha", "-0.015"},
|
||||
{"Alpha", "-0.022"},
|
||||
{"Beta", "-0.012"},
|
||||
{"Annual Standard Deviation", "0.005"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-2.823"},
|
||||
{"Tracking Error", "0.049"},
|
||||
{"Treynor Ratio", "1.372"},
|
||||
{"Treynor Ratio", "2.01"},
|
||||
{"Total Fees", "$2.00"},
|
||||
{"Estimated Strategy Capacity", "$67000000.00"},
|
||||
{"Estimated Strategy Capacity", "$5700000.00"},
|
||||
{"Lowest Capacity Asset", "AOL VRKS95ENLBYE|AOL R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "-43.418"},
|
||||
{"Return Over Maximum Drawdown", "-14.274"},
|
||||
{"Portfolio Turnover", "0.007"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "0.55%"},
|
||||
{"OrderListHash", "568fe7c2a11960436660db1231f2cfd2"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 5797;
|
||||
public long DataPoints => 5798;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -188,40 +188,22 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "0.200%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "-0.232%"},
|
||||
{"Sharpe Ratio", "-7.739"},
|
||||
{"Sharpe Ratio", "-8.903"},
|
||||
{"Probabilistic Sharpe Ratio", "1.216%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "0.024"},
|
||||
{"Alpha", "0.015"},
|
||||
{"Beta", "-0.171"},
|
||||
{"Annual Standard Deviation", "0.006"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-11.082"},
|
||||
{"Tracking Error", "0.043"},
|
||||
{"Treynor Ratio", "0.291"},
|
||||
{"Treynor Ratio", "0.335"},
|
||||
{"Total Fees", "$2.00"},
|
||||
{"Estimated Strategy Capacity", "$2800000.00"},
|
||||
{"Lowest Capacity Asset", "AOL VRKS95ENLBYE|AOL R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "-19.883"},
|
||||
{"Return Over Maximum Drawdown", "-67.224"},
|
||||
{"Portfolio Turnover", "0.014"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "1.14%"},
|
||||
{"OrderListHash", "ae0b430e9c728966e3736fb352a689c6"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -150,25 +150,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Fees", "$2.00"},
|
||||
{"Estimated Strategy Capacity", "$30000.00"},
|
||||
{"Lowest Capacity Asset", "AAPL VXBK4Q9ZIFD2|AAPL R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "-89.181"},
|
||||
{"Portfolio Turnover", "0"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "0.07%"},
|
||||
{"OrderListHash", "546b6182e1df2d222178454d8f311566"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all time slices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 6023980;
|
||||
public long DataPoints => 5952220;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -122,25 +122,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", ""},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "79228162514264337593543950335"},
|
||||
{"Portfolio Turnover", "0"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "0%"},
|
||||
{"OrderListHash", "d41d8cd98f00b204e9800998ecf8427e"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -247,25 +247,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Fees", "$6.00"},
|
||||
{"Estimated Strategy Capacity", "$2000.00"},
|
||||
{"Lowest Capacity Asset", "GOOCV 305RBR0BSWIX2|GOOCV VP83T1ZUHROL"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Return Over Maximum Drawdown", "0"},
|
||||
{"Portfolio Turnover", "0"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "1.19%"},
|
||||
{"OrderListHash", "550a99c482106defd8ba15f48183768e"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -102,40 +102,22 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "2.500%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "1.754%"},
|
||||
{"Sharpe Ratio", "11.994"},
|
||||
{"Sharpe Ratio", "11.954"},
|
||||
{"Probabilistic Sharpe Ratio", "74.160%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "0.618"},
|
||||
{"Alpha", "0.616"},
|
||||
{"Beta", "0.81"},
|
||||
{"Annual Standard Deviation", "0.185"},
|
||||
{"Annual Variance", "0.034"},
|
||||
{"Information Ratio", "3.961"},
|
||||
{"Tracking Error", "0.061"},
|
||||
{"Treynor Ratio", "2.746"},
|
||||
{"Treynor Ratio", "2.737"},
|
||||
{"Total Fees", "$21.45"},
|
||||
{"Estimated Strategy Capacity", "$830000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.204"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "43.135"},
|
||||
{"Return Over Maximum Drawdown", "261.238"},
|
||||
{"Portfolio Turnover", "0.204"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "20.49%"},
|
||||
{"OrderListHash", "6ee62edf1ac883882b0fcef8cb3e9bae"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -128,40 +128,22 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "1.400%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "1.776%"},
|
||||
{"Sharpe Ratio", "13.013"},
|
||||
{"Sharpe Ratio", "12.966"},
|
||||
{"Probabilistic Sharpe Ratio", "80.409%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "100%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "0.68"},
|
||||
{"Alpha", "0.678"},
|
||||
{"Beta", "0.707"},
|
||||
{"Annual Standard Deviation", "0.16"},
|
||||
{"Annual Variance", "0.026"},
|
||||
{"Information Ratio", "1.378"},
|
||||
{"Tracking Error", "0.072"},
|
||||
{"Treynor Ratio", "2.946"},
|
||||
{"Treynor Ratio", "2.935"},
|
||||
{"Total Fees", "$28.30"},
|
||||
{"Estimated Strategy Capacity", "$4700000.00"},
|
||||
{"Lowest Capacity Asset", "AIG R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.374"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "372.086"},
|
||||
{"Portfolio Turnover", "0.374"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "29.88%"},
|
||||
{"OrderListHash", "ac3f4dfcdeb98b488b715412ad2d6c4f"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -81,40 +81,22 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "2.200%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "1.775%"},
|
||||
{"Sharpe Ratio", "9.373"},
|
||||
{"Sharpe Ratio", "9.34"},
|
||||
{"Probabilistic Sharpe Ratio", "68.302%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "100%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "0.105"},
|
||||
{"Alpha", "0.106"},
|
||||
{"Beta", "1.021"},
|
||||
{"Annual Standard Deviation", "0.227"},
|
||||
{"Annual Variance", "0.052"},
|
||||
{"Information Ratio", "25.083"},
|
||||
{"Tracking Error", "0.006"},
|
||||
{"Treynor Ratio", "2.086"},
|
||||
{"Treynor Ratio", "2.079"},
|
||||
{"Total Fees", "$10.33"},
|
||||
{"Estimated Strategy Capacity", "$38000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.747"},
|
||||
{"Kelly Criterion Estimate", "38.796"},
|
||||
{"Kelly Criterion Probability Value", "0.228"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "107.013"},
|
||||
{"Portfolio Turnover", "0.747"},
|
||||
{"Total Insights Generated", "100"},
|
||||
{"Total Insights Closed", "99"},
|
||||
{"Total Insights Analysis Completed", "99"},
|
||||
{"Long Insight Count", "100"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$135639.1761"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$21852.9784"},
|
||||
{"Mean Population Estimated Insight Value", "$220.7372"},
|
||||
{"Mean Population Direction", "53.5354%"},
|
||||
{"Mean Population Magnitude", "53.5354%"},
|
||||
{"Rolling Averaged Population Direction", "58.2788%"},
|
||||
{"Rolling Averaged Population Magnitude", "58.2788%"},
|
||||
{"Portfolio Turnover", "59.74%"},
|
||||
{"OrderListHash", "af3a9c98c190d1b6b36fad184e796b0b"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -135,25 +135,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Fees", "$2.00"},
|
||||
{"Estimated Strategy Capacity", "$230000.00"},
|
||||
{"Lowest Capacity Asset", "AAPL VXBK4QQIRLZA|AAPL R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Return Over Maximum Drawdown", "0"},
|
||||
{"Portfolio Turnover", "0"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "0.25%"},
|
||||
{"OrderListHash", "228194dcc6fd8689a67f383577ee2d85"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -93,48 +93,30 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "11"},
|
||||
{"Total Trades", "10"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "-0.01%"},
|
||||
{"Compounding Annual Return", "-14.217%"},
|
||||
{"Compounding Annual Return", "-14.233%"},
|
||||
{"Drawdown", "3.300%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "-0.168%"},
|
||||
{"Sharpe Ratio", "62.513"},
|
||||
{"Sharpe Ratio", "62.464"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "1.118"},
|
||||
{"Alpha", "1.117"},
|
||||
{"Beta", "1.19"},
|
||||
{"Annual Standard Deviation", "0.213"},
|
||||
{"Annual Variance", "0.046"},
|
||||
{"Information Ratio", "70.862"},
|
||||
{"Information Ratio", "70.778"},
|
||||
{"Tracking Error", "0.043"},
|
||||
{"Treynor Ratio", "11.209"},
|
||||
{"Total Fees", "$23.21"},
|
||||
{"Treynor Ratio", "11.2"},
|
||||
{"Total Fees", "$22.21"},
|
||||
{"Estimated Strategy Capacity", "$340000000.00"},
|
||||
{"Lowest Capacity Asset", "FB V6OIPNZEM8V9"},
|
||||
{"Fitness Score", "0.147"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "1"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "-4.352"},
|
||||
{"Portfolio Turnover", "0.269"},
|
||||
{"Total Insights Generated", "15"},
|
||||
{"Total Insights Closed", "12"},
|
||||
{"Total Insights Analysis Completed", "12"},
|
||||
{"Long Insight Count", "15"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "a7a0983c8413ff241e7d223438f3d508"}
|
||||
{"Portfolio Turnover", "26.92%"},
|
||||
{"OrderListHash", "a259afcf4ee1c65ce5d26588ab645dbf"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,48 +104,30 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "27"},
|
||||
{"Average Win", "0.01%"},
|
||||
{"Total Trades", "21"},
|
||||
{"Average Win", "0.00%"},
|
||||
{"Average Loss", "-0.01%"},
|
||||
{"Compounding Annual Return", "-75.320%"},
|
||||
{"Compounding Annual Return", "-75.275%"},
|
||||
{"Drawdown", "5.800%"},
|
||||
{"Expectancy", "-0.731"},
|
||||
{"Net Profit", "-5.588%"},
|
||||
{"Sharpe Ratio", "-3.252"},
|
||||
{"Probabilistic Sharpe Ratio", "5.526%"},
|
||||
{"Loss Rate", "86%"},
|
||||
{"Win Rate", "14%"},
|
||||
{"Profit-Loss Ratio", "0.89"},
|
||||
{"Alpha", "-0.499"},
|
||||
{"Beta", "1.483"},
|
||||
{"Expectancy", "-0.609"},
|
||||
{"Net Profit", "-5.581%"},
|
||||
{"Sharpe Ratio", "-3.288"},
|
||||
{"Probabilistic Sharpe Ratio", "5.546%"},
|
||||
{"Loss Rate", "73%"},
|
||||
{"Win Rate", "27%"},
|
||||
{"Profit-Loss Ratio", "0.43"},
|
||||
{"Alpha", "-0.495"},
|
||||
{"Beta", "1.484"},
|
||||
{"Annual Standard Deviation", "0.196"},
|
||||
{"Annual Variance", "0.039"},
|
||||
{"Information Ratio", "-3.844"},
|
||||
{"Tracking Error", "0.142"},
|
||||
{"Treynor Ratio", "-0.43"},
|
||||
{"Total Fees", "$37.25"},
|
||||
{"Estimated Strategy Capacity", "$520000000.00"},
|
||||
{"Information Ratio", "-3.843"},
|
||||
{"Tracking Error", "0.141"},
|
||||
{"Treynor Ratio", "-0.435"},
|
||||
{"Total Fees", "$31.25"},
|
||||
{"Estimated Strategy Capacity", "$550000000.00"},
|
||||
{"Lowest Capacity Asset", "AAPL R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.004"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "1"},
|
||||
{"Sortino Ratio", "-4.469"},
|
||||
{"Return Over Maximum Drawdown", "-13.057"},
|
||||
{"Portfolio Turnover", "0.084"},
|
||||
{"Total Insights Generated", "33"},
|
||||
{"Total Insights Closed", "30"},
|
||||
{"Total Insights Analysis Completed", "30"},
|
||||
{"Long Insight Count", "33"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "f837879b96f5e565b60fd040299d2123"}
|
||||
{"Portfolio Turnover", "7.33%"},
|
||||
{"OrderListHash", "6aab808e341ae46946b91ba378073531"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,25 +190,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Fees", "$21.60"},
|
||||
{"Estimated Strategy Capacity", "$42000000.00"},
|
||||
{"Lowest Capacity Asset", "AAPL R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Return Over Maximum Drawdown", "0"},
|
||||
{"Portfolio Turnover", "0"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "99.56%"},
|
||||
{"OrderListHash", "18e41dded4f8cee548ee02b03ffb0814"}
|
||||
};
|
||||
}
|
||||
|
||||
111
Algorithm.CSharp/AlgorithmModeAndDeploymentTargetAlgorithm.cs
Normal file
111
Algorithm.CSharp/AlgorithmModeAndDeploymentTargetAlgorithm.cs
Normal file
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
|
||||
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using QuantConnect.Interfaces;
|
||||
|
||||
namespace QuantConnect.Algorithm.CSharp
|
||||
{
|
||||
/// <summary>
|
||||
/// Algorithm asserting the correct values for the deployment target and algorithm mode.
|
||||
/// </summary>
|
||||
public class AlgorithmModeAndDeploymentTargetAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
SetStartDate(2013, 10, 07);
|
||||
SetEndDate(2013, 10, 07);
|
||||
SetCash(100000);
|
||||
|
||||
Debug($"Algorithm Mode: {AlgorithmMode}. Is Live Mode: {LiveMode}. Deployment Target: {DeploymentTarget}.");
|
||||
|
||||
if (AlgorithmMode != AlgorithmMode.Backtesting)
|
||||
{
|
||||
throw new Exception($"Algorithm mode is not backtesting. Actual: {AlgorithmMode}");
|
||||
}
|
||||
|
||||
if (LiveMode)
|
||||
{
|
||||
throw new Exception("Algorithm should not be live");
|
||||
}
|
||||
|
||||
if (DeploymentTarget != DeploymentTarget.LocalPlatform)
|
||||
{
|
||||
throw new Exception($"Algorithm deployment target is not local. Actual{DeploymentTarget}");
|
||||
}
|
||||
|
||||
// For a live deployment these checks should pass:
|
||||
//if (AlgorithmMode != AlgorithmMode.Live) throw new Exception("Algorithm mode is not live");
|
||||
//if (!LiveMode) throw new Exception("Algorithm should be live");
|
||||
|
||||
// For a cloud deployment these checks should pass:
|
||||
//if (DeploymentTarget != DeploymentTarget.CloudPlatform) throw new Exception("Algorithm deployment target is not cloud");
|
||||
|
||||
Quit();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.
|
||||
/// </summary>
|
||||
public bool CanRunLocally { get; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// This is used by the regression test system to indicate which languages this algorithm is written in.
|
||||
/// </summary>
|
||||
public Language[] Languages { get; } = { Language.CSharp, Language.Python };
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 0;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
/// </summary>
|
||||
public int AlgorithmHistoryDataPoints => 0;
|
||||
|
||||
/// <summary>
|
||||
/// This is used by the regression test system to indicate what the expected statistics are from running the algorithm
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "0"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
{"Drawdown", "0%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "0"},
|
||||
{"Beta", "0"},
|
||||
{"Annual Standard Deviation", "0"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "0"},
|
||||
{"Tracking Error", "0"},
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", ""},
|
||||
{"Portfolio Turnover", "0%"},
|
||||
{"OrderListHash", "d41d8cd98f00b204e9800998ecf8427e"}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -17,10 +17,12 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using QuantConnect.Brokerages;
|
||||
using QuantConnect.Securities;
|
||||
using QuantConnect.Data;
|
||||
using QuantConnect.Data.Shortable;
|
||||
using QuantConnect.Data.UniverseSelection;
|
||||
using QuantConnect.Interfaces;
|
||||
using System.IO;
|
||||
|
||||
namespace QuantConnect.Algorithm.CSharp
|
||||
{
|
||||
@@ -82,11 +84,15 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{ _20140329, new Symbol[0] }
|
||||
};
|
||||
|
||||
private Security _security;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
SetStartDate(2014, 3, 25);
|
||||
SetEndDate(2014, 3, 29);
|
||||
SetCash(10000000);
|
||||
_security = AddEquity(_spy);
|
||||
_security.SetShortableProvider(new RegressionTestShortableProvider());
|
||||
|
||||
AddUniverse(CoarseSelection);
|
||||
UniverseSettings.Resolution = Resolution.Daily;
|
||||
@@ -120,7 +126,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
|
||||
private IEnumerable<Symbol> CoarseSelection(IEnumerable<CoarseFundamental> coarse)
|
||||
{
|
||||
var shortableSymbols = AllShortableSymbols();
|
||||
var shortableSymbols = (_security.ShortableProvider as dynamic).AllShortableSymbols(Time);
|
||||
var selectedSymbols = coarse
|
||||
.Select(x => x.Symbol)
|
||||
.Where(s => shortableSymbols.ContainsKey(s) && shortableSymbols[s] >= 500)
|
||||
@@ -174,6 +180,47 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
public RegressionTestShortableProvider() : base(SecurityType.Equity, "testbrokerage", Market.USA)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of all shortable Symbols, including the quantity shortable as a Dictionary.
|
||||
/// </summary>
|
||||
/// <param name="localTime">The algorithm's local time</param>
|
||||
/// <returns>Symbol/quantity shortable as a Dictionary. Returns null if no entry data exists for this date or brokerage</returns>
|
||||
public Dictionary<Symbol, long> AllShortableSymbols(DateTime localTime)
|
||||
{
|
||||
var allSymbols = new Dictionary<Symbol, long>();
|
||||
|
||||
// Check backwards up to one week to see if we can source a previous file.
|
||||
// If not, then we return a list of all Symbols with quantity set to zero.
|
||||
var i = 0;
|
||||
while (i <= 7)
|
||||
{
|
||||
var shortableListFile = Path.Combine(ShortableDataDirectory.FullName, "dates", $"{localTime.AddDays(-i):yyyyMMdd}.csv");
|
||||
|
||||
foreach (var line in DataProvider.ReadLines(shortableListFile))
|
||||
{
|
||||
var csv = line.Split(',');
|
||||
var ticker = csv[0];
|
||||
|
||||
var symbol = new Symbol(
|
||||
SecurityIdentifier.GenerateEquity(ticker, QuantConnect.Market.USA,
|
||||
mappingResolveDate: localTime), ticker);
|
||||
var quantity = Parse.Long(csv[1]);
|
||||
|
||||
allSymbols[symbol] = quantity;
|
||||
}
|
||||
|
||||
if (allSymbols.Count > 0)
|
||||
{
|
||||
return allSymbols;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
// Return our empty dictionary if we did not find a file to extract
|
||||
return allSymbols;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -184,12 +231,12 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// This is used by the regression test system to indicate which languages this algorithm is written in.
|
||||
/// </summary>
|
||||
public Language[] Languages { get; } = { Language.CSharp, Language.Python };
|
||||
public Language[] Languages { get; } = { Language.CSharp};
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 35410;
|
||||
public long DataPoints => 37754;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -208,40 +255,22 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "0%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0.192%"},
|
||||
{"Sharpe Ratio", "231.673"},
|
||||
{"Sharpe Ratio", "221.176"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "0.163"},
|
||||
{"Alpha", "0.156"},
|
||||
{"Beta", "-0.007"},
|
||||
{"Annual Standard Deviation", "0.001"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "4.804"},
|
||||
{"Tracking Error", "0.098"},
|
||||
{"Treynor Ratio", "-22.526"},
|
||||
{"Treynor Ratio", "-21.505"},
|
||||
{"Total Fees", "$307.50"},
|
||||
{"Estimated Strategy Capacity", "$2600000.00"},
|
||||
{"Lowest Capacity Asset", "GOOCV VP83T1ZUHROL"},
|
||||
{"Fitness Score", "0.106"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "79228162514264337593543950335"},
|
||||
{"Portfolio Turnover", "0.106"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "10.61%"},
|
||||
{"OrderListHash", "0069f402ffcd2d91b9018b81badfab81"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -102,25 +102,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$83000.00"},
|
||||
{"Lowest Capacity Asset", "BTCUSD XJ"},
|
||||
{"Fitness Score", "0.017"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "-138.588"},
|
||||
{"Portfolio Turnover", "0.034"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "2.31%"},
|
||||
{"OrderListHash", "2b94bc50a74caebe06c075cdab1bc6da"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "3.100%"},
|
||||
{"Expectancy", "7.797"},
|
||||
{"Net Profit", "-1.134%"},
|
||||
{"Sharpe Ratio", "-2.456"},
|
||||
{"Sharpe Ratio", "-2.522"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "50%"},
|
||||
{"Win Rate", "50%"},
|
||||
@@ -74,29 +74,11 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Annual Variance", "0.117"},
|
||||
{"Information Ratio", "-0.859"},
|
||||
{"Tracking Error", "0.004"},
|
||||
{"Treynor Ratio", "-0.832"},
|
||||
{"Treynor Ratio", "-0.854"},
|
||||
{"Total Fees", "€2.89"},
|
||||
{"Estimated Strategy Capacity", "€8900000000.00"},
|
||||
{"Lowest Capacity Asset", "AAPL R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.506"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "79228162514264337593543950335"},
|
||||
{"Portfolio Turnover", "0.506"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "€0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "€0"},
|
||||
{"Mean Population Estimated Insight Value", "€0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "33.78%"},
|
||||
{"OrderListHash", "a9dd0a0ab6070455479d1b9caaa4e69c"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -115,25 +115,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$83000.00"},
|
||||
{"Lowest Capacity Asset", "BTCUSD XJ"},
|
||||
{"Fitness Score", "0.011"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "-113.513"},
|
||||
{"Portfolio Turnover", "0.023"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "2.31%"},
|
||||
{"OrderListHash", "2b94bc50a74caebe06c075cdab1bc6da"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{
|
||||
var security = Securities["SPY"];
|
||||
var priceInAccountCurrency = Portfolio.CashBook.ConvertToAccountCurrency(security.AskPrice, security.QuoteCurrency.Symbol);
|
||||
_expectedSpyQuantity = (Portfolio.TotalPortfolioValue - Settings.FreePortfolioValue) / priceInAccountCurrency;
|
||||
_expectedSpyQuantity = Portfolio.TotalPortfolioValueLessFreeBuffer / priceInAccountCurrency;
|
||||
_expectedSpyQuantity = _expectedSpyQuantity.DiscretelyRoundBy(1, MidpointRounding.ToZero);
|
||||
}
|
||||
|
||||
@@ -114,40 +114,22 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "3.100%"},
|
||||
{"Expectancy", "8.518"},
|
||||
{"Net Profit", "-1.515%"},
|
||||
{"Sharpe Ratio", "-2.45"},
|
||||
{"Sharpe Ratio", "-2.515"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "50%"},
|
||||
{"Win Rate", "50%"},
|
||||
{"Profit-Loss Ratio", "18.04"},
|
||||
{"Alpha", "0.008"},
|
||||
{"Alpha", "0.009"},
|
||||
{"Beta", "1.015"},
|
||||
{"Annual Standard Deviation", "0.344"},
|
||||
{"Annual Variance", "0.118"},
|
||||
{"Information Ratio", "-0.856"},
|
||||
{"Tracking Error", "0.005"},
|
||||
{"Treynor Ratio", "-0.83"},
|
||||
{"Treynor Ratio", "-0.852"},
|
||||
{"Total Fees", "$3.09"},
|
||||
{"Estimated Strategy Capacity", "$8900000000.00"},
|
||||
{"Lowest Capacity Asset", "AAPL R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.511"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "6113.173"},
|
||||
{"Portfolio Turnover", "0.511"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "34.12%"},
|
||||
{"OrderListHash", "788eb2c74715a78476ba0db3b2654eb6"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -195,11 +195,11 @@ namespace QuantConnect.Algorithm.CSharp.Alphas
|
||||
private const int _numberOfSymbolsFine = 20;
|
||||
private const int _numberOfSymbolsInPortfolio = 10;
|
||||
private int _lastMonth = -1;
|
||||
private Dictionary<Symbol, decimal> _dollarVolumeBySymbol;
|
||||
private Dictionary<Symbol, double> _dollarVolumeBySymbol;
|
||||
|
||||
public GreenBlattMagicFormulaUniverseSelectionModel() : base(true)
|
||||
{
|
||||
_dollarVolumeBySymbol = new Dictionary<Symbol, decimal>();
|
||||
_dollarVolumeBySymbol = new ();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -245,7 +245,7 @@ namespace QuantConnect.Algorithm.CSharp.Alphas
|
||||
where x.CompanyReference.CountryId == "USA"
|
||||
where x.CompanyReference.PrimaryExchangeID == "NYS" || x.CompanyReference.PrimaryExchangeID == "NAS"
|
||||
where (algorithm.Time - x.SecurityReference.IPODate).TotalDays > 180
|
||||
where x.EarningReports.BasicAverageShares.ThreeMonths * x.EarningReports.BasicEPS.TwelveMonths * x.ValuationRatios.PERatio > 5e8m
|
||||
where x.EarningReports.BasicAverageShares.ThreeMonths * x.EarningReports.BasicEPS.TwelveMonths * x.ValuationRatios.PERatio > 5e8
|
||||
select x;
|
||||
|
||||
double count = filteredFine.Count();
|
||||
@@ -287,4 +287,4 @@ namespace QuantConnect.Algorithm.CSharp.Alphas
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,40 +95,22 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "0.100%"},
|
||||
{"Expectancy", "3.321"},
|
||||
{"Net Profit", "0.089%"},
|
||||
{"Sharpe Ratio", "0.798"},
|
||||
{"Sharpe Ratio", "-8.214"},
|
||||
{"Probabilistic Sharpe Ratio", "40.893%"},
|
||||
{"Loss Rate", "24%"},
|
||||
{"Win Rate", "76%"},
|
||||
{"Profit-Loss Ratio", "4.67"},
|
||||
{"Alpha", "-0.001"},
|
||||
{"Alpha", "-0.008"},
|
||||
{"Beta", "0.008"},
|
||||
{"Annual Standard Deviation", "0.001"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-1.961"},
|
||||
{"Tracking Error", "0.092"},
|
||||
{"Treynor Ratio", "0.08"},
|
||||
{"Treynor Ratio", "-0.826"},
|
||||
{"Total Fees", "$52.00"},
|
||||
{"Estimated Strategy Capacity", "$32000000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "1.266"},
|
||||
{"Return Over Maximum Drawdown", "1.622"},
|
||||
{"Portfolio Turnover", "0"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "0.02%"},
|
||||
{"OrderListHash", "cf43585a8d1781f04b53a4f1ee3380cb"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -165,40 +165,22 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "15.900%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "6.828%"},
|
||||
{"Sharpe Ratio", "203744786353.302"},
|
||||
{"Sharpe Ratio", "203744786353.299"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "456382350698.561"},
|
||||
{"Alpha", "456382350698.622"},
|
||||
{"Beta", "9.229"},
|
||||
{"Annual Standard Deviation", "2.24"},
|
||||
{"Annual Variance", "5.017"},
|
||||
{"Information Ratio", "228504036840.953"},
|
||||
{"Tracking Error", "1.997"},
|
||||
{"Treynor Ratio", "49450701625.718"},
|
||||
{"Treynor Ratio", "49450701625.717"},
|
||||
{"Total Fees", "$23.65"},
|
||||
{"Estimated Strategy Capacity", "$200000000.00"},
|
||||
{"Lowest Capacity Asset", "ES VMKLFZIH2MTD"},
|
||||
{"Fitness Score", "0.518"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "-7.708"},
|
||||
{"Portfolio Turnover", "5.277"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "351.80%"},
|
||||
{"OrderListHash", "dd38e7b94027d20942a5aa9ac31a9a7f"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "2.200%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "1.692%"},
|
||||
{"Sharpe Ratio", "8.888"},
|
||||
{"Sharpe Ratio", "8.854"},
|
||||
{"Probabilistic Sharpe Ratio", "67.609%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -138,29 +138,11 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Annual Variance", "0.049"},
|
||||
{"Information Ratio", "-14.565"},
|
||||
{"Tracking Error", "0.001"},
|
||||
{"Treynor Ratio", "1.978"},
|
||||
{"Treynor Ratio", "1.97"},
|
||||
{"Total Fees", "$3.44"},
|
||||
{"Estimated Strategy Capacity", "$56000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.248"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "93.728"},
|
||||
{"Portfolio Turnover", "0.248"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "19.93%"},
|
||||
{"OrderListHash", "9e4bfd2eb0b81ee5bc1b197a87ccedbe"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -296,7 +296,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 1341291;
|
||||
public long DataPoints => 1272232;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -315,40 +315,22 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "0.400%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "-0.329%"},
|
||||
{"Sharpe Ratio", "-7.887"},
|
||||
{"Sharpe Ratio", "-14.095"},
|
||||
{"Probabilistic Sharpe Ratio", "1.216%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "-0.001"},
|
||||
{"Alpha", "-0.01"},
|
||||
{"Beta", "0.097"},
|
||||
{"Annual Standard Deviation", "0.002"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "7.39"},
|
||||
{"Tracking Error", "0.015"},
|
||||
{"Treynor Ratio", "-0.131"},
|
||||
{"Treynor Ratio", "-0.234"},
|
||||
{"Total Fees", "$2.00"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", "GOOCV VP83T1ZUHROL"},
|
||||
{"Fitness Score", "0.212"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "-73.334"},
|
||||
{"Portfolio Turnover", "0.425"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "17.02%"},
|
||||
{"OrderListHash", "85cbf92f01c2c91b5f710b7eeefecbe1"}
|
||||
};
|
||||
}
|
||||
|
||||
95
Algorithm.CSharp/BaseFrameworkRegressionAlgorithm.cs
Normal file
95
Algorithm.CSharp/BaseFrameworkRegressionAlgorithm.cs
Normal file
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
|
||||
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using QuantConnect.Algorithm.Framework.Alphas;
|
||||
using QuantConnect.Algorithm.Framework.Execution;
|
||||
using QuantConnect.Algorithm.Framework.Portfolio;
|
||||
using QuantConnect.Algorithm.Framework.Risk;
|
||||
using QuantConnect.Algorithm.Framework.Selection;
|
||||
using QuantConnect.Interfaces;
|
||||
|
||||
namespace QuantConnect.Algorithm.CSharp
|
||||
{
|
||||
/// <summary>
|
||||
/// Abstract regression framework algorithm for multiple framework regression tests
|
||||
/// </summary>
|
||||
public abstract class BaseFrameworkRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
SetStartDate(2014, 6, 1);
|
||||
SetEndDate(2014, 6, 30);
|
||||
|
||||
UniverseSettings.Resolution = Resolution.Hour;
|
||||
UniverseSettings.DataNormalizationMode = DataNormalizationMode.Raw;
|
||||
|
||||
var symbols = new[] { "AAPL", "AIG", "BAC", "SPY" }
|
||||
.Select(ticker => QuantConnect.Symbol.Create(ticker, SecurityType.Equity, Market.USA))
|
||||
.ToList();
|
||||
|
||||
// Manually add AAPL and AIG when the algorithm starts
|
||||
SetUniverseSelection(new ManualUniverseSelectionModel(symbols.Take(2)));
|
||||
|
||||
// At midnight, add all securities every day except on the last data
|
||||
// With this procedure, the Alpha Model will experience multiple universe changes
|
||||
AddUniverseSelection(new ScheduledUniverseSelectionModel(
|
||||
DateRules.EveryDay(), TimeRules.Midnight,
|
||||
dt => dt < EndDate.AddDays(-1) ? symbols : Enumerable.Empty<Symbol>()));
|
||||
|
||||
SetAlpha(new ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromDays(31), 0.025, null));
|
||||
SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());
|
||||
SetExecution(new ImmediateExecutionModel());
|
||||
SetRiskManagement(new NullRiskManagementModel());
|
||||
}
|
||||
|
||||
public override void OnEndOfAlgorithm()
|
||||
{
|
||||
// The base implementation checks for active insights
|
||||
var insightsCount = Insights.GetInsights(insight => insight.IsActive(UtcTime)).Count;
|
||||
if (insightsCount != 0)
|
||||
{
|
||||
throw new Exception($"The number of active insights should be 0. Actual: {insightsCount}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.
|
||||
/// </summary>
|
||||
public bool CanRunLocally { get; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// This is used by the regression test system to indicate which languages this algorithm is written in.
|
||||
/// </summary>
|
||||
public virtual Language[] Languages { get; } = { Language.CSharp, Language.Python };
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public virtual long DataPoints => 765;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
/// </summary>
|
||||
public virtual int AlgorithmHistoryDataPoints => 0;
|
||||
|
||||
/// <summary>
|
||||
/// This is used by the regression test system to indicate what the expected statistics are from running the algorithm
|
||||
/// </summary>
|
||||
public abstract Dictionary<string, string> ExpectedStatistics { get; }
|
||||
}
|
||||
}
|
||||
@@ -35,11 +35,15 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
SetStartDate(2018, 04, 04); //Set Start Date
|
||||
SetEndDate(2018, 04, 04); //Set End Date
|
||||
SetBrokerageModel(BrokerageName.GDAX, AccountType.Cash);
|
||||
SetAccountCurrency();
|
||||
_btcEur = AddCrypto("BTCEUR").Symbol;
|
||||
}
|
||||
|
||||
public virtual void SetAccountCurrency()
|
||||
{
|
||||
//Before setting any cash or adding a Security call SetAccountCurrency
|
||||
SetAccountCurrency("EUR");
|
||||
SetCash(100000); //Set Strategy Cash
|
||||
|
||||
_btcEur = AddCrypto("BTCEUR").Symbol;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -102,25 +106,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Fees", "€298.35"},
|
||||
{"Estimated Strategy Capacity", "€85000.00"},
|
||||
{"Lowest Capacity Asset", "BTCEUR XJ"},
|
||||
{"Fitness Score", "0.506"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "-13.614"},
|
||||
{"Portfolio Turnover", "1.073"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "€0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "€0"},
|
||||
{"Mean Population Estimated Insight Value", "€0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "107.64%"},
|
||||
{"OrderListHash", "2ba443899dcccc79dc0f04441f797bf9"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
|
||||
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using QuantConnect.Interfaces;
|
||||
|
||||
namespace QuantConnect.Algorithm.CSharp
|
||||
{
|
||||
/// <summary>
|
||||
/// Basic algorithm using SetAccountCurrency with an amount
|
||||
/// </summary>
|
||||
public class BasicSetAccountCurrencyWithAmountAlgorithm : BasicSetAccountCurrencyAlgorithm, IRegressionAlgorithmDefinition
|
||||
{
|
||||
public override void SetAccountCurrency()
|
||||
{
|
||||
//Before setting any cash or adding a Security call SetAccountCurrency
|
||||
SetAccountCurrency("EUR", 200000);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.
|
||||
/// </summary>
|
||||
public bool CanRunLocally { get; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// This is used by the regression test system to indicate which languages this algorithm is written in.
|
||||
/// </summary>
|
||||
public Language[] Languages { get; } = { Language.CSharp, Language.Python };
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 4319;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
/// </summary>
|
||||
public int AlgorithmHistoryDataPoints => 120;
|
||||
|
||||
/// <summary>
|
||||
/// This is used by the regression test system to indicate what the expected statistics are from running the algorithm
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "1"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
{"Drawdown", "0%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "0"},
|
||||
{"Beta", "0"},
|
||||
{"Annual Standard Deviation", "0"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "0"},
|
||||
{"Tracking Error", "0"},
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "€596.71"},
|
||||
{"Estimated Strategy Capacity", "€85000.00"},
|
||||
{"Lowest Capacity Asset", "BTCEUR XJ"},
|
||||
{"Portfolio Turnover", "107.64%"},
|
||||
{"OrderListHash", "af1850fbc1faefaf2da98080e92c43a0"}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -94,7 +94,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "2.200%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "1.692%"},
|
||||
{"Sharpe Ratio", "8.888"},
|
||||
{"Sharpe Ratio", "8.854"},
|
||||
{"Probabilistic Sharpe Ratio", "67.609%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -105,29 +105,11 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Annual Variance", "0.049"},
|
||||
{"Information Ratio", "-14.565"},
|
||||
{"Tracking Error", "0.001"},
|
||||
{"Treynor Ratio", "1.978"},
|
||||
{"Treynor Ratio", "1.97"},
|
||||
{"Total Fees", "$3.44"},
|
||||
{"Estimated Strategy Capacity", "$56000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.248"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "93.728"},
|
||||
{"Portfolio Turnover", "0.248"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "19.93%"},
|
||||
{"OrderListHash", "9e4bfd2eb0b81ee5bc1b197a87ccedbe"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "0.500%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0.423%"},
|
||||
{"Sharpe Ratio", "5.634"},
|
||||
{"Sharpe Ratio", "5.498"},
|
||||
{"Probabilistic Sharpe Ratio", "67.498%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -110,25 +110,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Fees", "$0.60"},
|
||||
{"Estimated Strategy Capacity", "$150000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.062"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "71.634"},
|
||||
{"Portfolio Turnover", "0.062"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "4.98%"},
|
||||
{"OrderListHash", "d549c64ee7f5e3866712b3c7dbd64caa"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
contractDepthOffset: 0
|
||||
);
|
||||
|
||||
_fast = SMA(_continuousContract.Symbol, 3, Resolution.Daily);
|
||||
_fast = SMA(_continuousContract.Symbol, 4, Resolution.Daily);
|
||||
_slow = SMA(_continuousContract.Symbol, 10, Resolution.Daily);
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 709638;
|
||||
public long DataPoints => 703956;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -130,48 +130,30 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "2"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "-0.02%"},
|
||||
{"Compounding Annual Return", "-0.033%"},
|
||||
{"Drawdown", "0.000%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "-0.017%"},
|
||||
{"Sharpe Ratio", "-1.173"},
|
||||
{"Probabilistic Sharpe Ratio", "0.011%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Total Trades", "3"},
|
||||
{"Average Win", "5.51%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "12.437%"},
|
||||
{"Drawdown", "1.500%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "6.079%"},
|
||||
{"Sharpe Ratio", "1.465"},
|
||||
{"Probabilistic Sharpe Ratio", "88.038%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "100%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "-0"},
|
||||
{"Beta", "-0"},
|
||||
{"Annual Standard Deviation", "0"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-2.752"},
|
||||
{"Tracking Error", "0.082"},
|
||||
{"Treynor Ratio", "1.883"},
|
||||
{"Total Fees", "$4.30"},
|
||||
{"Alpha", "0.083"},
|
||||
{"Beta", "-0.02"},
|
||||
{"Annual Standard Deviation", "0.054"},
|
||||
{"Annual Variance", "0.003"},
|
||||
{"Information Ratio", "-1.399"},
|
||||
{"Tracking Error", "0.099"},
|
||||
{"Treynor Ratio", "-3.904"},
|
||||
{"Total Fees", "$6.45"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", "ES VMKLFZIH2MTD"},
|
||||
{"Fitness Score", "0.006"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "-1.996"},
|
||||
{"Portfolio Turnover", "0.01"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "1fd4b49e9450800981c6dead2bbca995"}
|
||||
{"Portfolio Turnover", "1.39%"},
|
||||
{"OrderListHash", "624c51bc6451dfb74335b99c04e3ed16"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
extendedMarketHours: true
|
||||
);
|
||||
|
||||
_fast = SMA(_continuousContract.Symbol, 3, Resolution.Daily);
|
||||
_fast = SMA(_continuousContract.Symbol, 4, Resolution.Daily);
|
||||
_slow = SMA(_continuousContract.Symbol, 10, Resolution.Daily);
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 2202510;
|
||||
public long DataPoints => 2169065;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -135,48 +135,30 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "2"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "-0.02%"},
|
||||
{"Compounding Annual Return", "-0.033%"},
|
||||
{"Drawdown", "0.000%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "-0.017%"},
|
||||
{"Sharpe Ratio", "-1.173"},
|
||||
{"Probabilistic Sharpe Ratio", "0.011%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "-0"},
|
||||
{"Beta", "-0"},
|
||||
{"Annual Standard Deviation", "0"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-2.752"},
|
||||
{"Tracking Error", "0.082"},
|
||||
{"Treynor Ratio", "1.883"},
|
||||
{"Total Fees", "$4.30"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Total Trades", "5"},
|
||||
{"Average Win", "4.45%"},
|
||||
{"Average Loss", "-0.26%"},
|
||||
{"Compounding Annual Return", "8.423%"},
|
||||
{"Drawdown", "0.800%"},
|
||||
{"Expectancy", "8.202"},
|
||||
{"Net Profit", "4.162%"},
|
||||
{"Sharpe Ratio", "0.951"},
|
||||
{"Probabilistic Sharpe Ratio", "53.568%"},
|
||||
{"Loss Rate", "50%"},
|
||||
{"Win Rate", "50%"},
|
||||
{"Profit-Loss Ratio", "17.40"},
|
||||
{"Alpha", "0.053"},
|
||||
{"Beta", "-0.005"},
|
||||
{"Annual Standard Deviation", "0.054"},
|
||||
{"Annual Variance", "0.003"},
|
||||
{"Information Ratio", "-1.681"},
|
||||
{"Tracking Error", "0.099"},
|
||||
{"Treynor Ratio", "-10.255"},
|
||||
{"Total Fees", "$10.75"},
|
||||
{"Estimated Strategy Capacity", "$190000000.00"},
|
||||
{"Lowest Capacity Asset", "ES VMKLFZIH2MTD"},
|
||||
{"Fitness Score", "0.006"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "-1.985"},
|
||||
{"Portfolio Turnover", "0.01"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "adb237703e65b93da5961c0085109732"}
|
||||
{"Portfolio Turnover", "2.34%"},
|
||||
{"OrderListHash", "2a0aa0c11df66d81ebf0f7b3e9048bbc"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,25 +235,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Fees", "$85.34"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", "BTCEUR XJ"},
|
||||
{"Fitness Score", "0.5"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "-43.943"},
|
||||
{"Portfolio Turnover", "1.028"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "118.08%"},
|
||||
{"OrderListHash", "1bf1a6d9dd921982b72a6178f9e50e68"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
SetStartDate(2022, 12, 13); // Set Start Date
|
||||
SetEndDate(2022, 12, 13); // Set End Date
|
||||
|
||||
SetTimeZone(NodaTime.DateTimeZone.Utc);
|
||||
SetTimeZone(TimeZones.Utc);
|
||||
|
||||
try
|
||||
{
|
||||
@@ -228,7 +228,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// This is used by the regression test system to indicate which languages this algorithm is written in.
|
||||
/// </summary>
|
||||
public Language[] Languages { get; } = { Language.CSharp };
|
||||
public Language[] Languages { get; } = { Language.CSharp, Language.Python };
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
@@ -265,28 +265,10 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Tracking Error", "0"},
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$0.65"},
|
||||
{"Estimated Strategy Capacity", "$630000000.00"},
|
||||
{"Estimated Strategy Capacity", "$500000000.00"},
|
||||
{"Lowest Capacity Asset", "ADAUSDT 18R"},
|
||||
{"Fitness Score", "0.001"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "79228162514264337593543950335"},
|
||||
{"Portfolio Turnover", "0.001"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "d4520985f69c915060f6bee3b7926cf5"}
|
||||
{"Portfolio Turnover", "0.16%"},
|
||||
{"OrderListHash", "254f39d98378b1e7aa397b1f1e49c6cc"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
SetStartDate(2022, 12, 13);
|
||||
SetEndDate(2022, 12, 13);
|
||||
|
||||
SetTimeZone(NodaTime.DateTimeZone.Utc);
|
||||
SetTimeZone(TimeZones.Utc);
|
||||
|
||||
try
|
||||
{
|
||||
@@ -191,7 +191,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// This is used by the regression test system to indicate which languages this algorithm is written in.
|
||||
/// </summary>
|
||||
public Language[] Languages { get; } = { Language.CSharp };
|
||||
public Language[] Languages { get; } = { Language.CSharp, Language.Python };
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
@@ -228,28 +228,10 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Tracking Error", "0"},
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$0.61"},
|
||||
{"Estimated Strategy Capacity", "$520000000.00"},
|
||||
{"Estimated Strategy Capacity", "$370000000.00"},
|
||||
{"Lowest Capacity Asset", "ADAUSDT 18R"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "-364.224"},
|
||||
{"Portfolio Turnover", "0.001"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "17f99ecc3f35f94fff1ea5694c40d32c"}
|
||||
{"Portfolio Turnover", "0.12%"},
|
||||
{"OrderListHash", "d2c6198197a4d18fa0a81f5933d935a6"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "1.200%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "3.464%"},
|
||||
{"Sharpe Ratio", "19.148"},
|
||||
{"Sharpe Ratio", "19.094"},
|
||||
{"Probabilistic Sharpe Ratio", "97.754%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -96,29 +96,11 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Annual Variance", "0.019"},
|
||||
{"Information Ratio", "-34.028"},
|
||||
{"Tracking Error", "0"},
|
||||
{"Treynor Ratio", "2.651"},
|
||||
{"Treynor Ratio", "2.644"},
|
||||
{"Total Fees", "$3.45"},
|
||||
{"Estimated Strategy Capacity", "$970000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.112"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "53.951"},
|
||||
{"Return Over Maximum Drawdown", "209.464"},
|
||||
{"Portfolio Turnover", "0.112"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "10.09%"},
|
||||
{"OrderListHash", "33d01821923c397f999cfb2e5b5928ad"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "2.200%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "1.655%"},
|
||||
{"Sharpe Ratio", "8.505"},
|
||||
{"Sharpe Ratio", "8.472"},
|
||||
{"Probabilistic Sharpe Ratio", "66.840%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -117,29 +117,11 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Annual Variance", "0.05"},
|
||||
{"Information Ratio", "-33.445"},
|
||||
{"Tracking Error", "0.002"},
|
||||
{"Treynor Ratio", "1.893"},
|
||||
{"Treynor Ratio", "1.885"},
|
||||
{"Total Fees", "$10.32"},
|
||||
{"Estimated Strategy Capacity", "$27000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.747"},
|
||||
{"Kelly Criterion Estimate", "38.796"},
|
||||
{"Kelly Criterion Probability Value", "0.228"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "85.095"},
|
||||
{"Portfolio Turnover", "0.747"},
|
||||
{"Total Insights Generated", "100"},
|
||||
{"Total Insights Closed", "99"},
|
||||
{"Total Insights Analysis Completed", "99"},
|
||||
{"Long Insight Count", "100"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$135639.1761"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$21852.9784"},
|
||||
{"Mean Population Estimated Insight Value", "$220.7372"},
|
||||
{"Mean Population Direction", "53.5354%"},
|
||||
{"Mean Population Magnitude", "53.5354%"},
|
||||
{"Rolling Averaged Population Direction", "58.2788%"},
|
||||
{"Rolling Averaged Population Magnitude", "58.2788%"},
|
||||
{"Portfolio Turnover", "59.86%"},
|
||||
{"OrderListHash", "ad2216297c759d8e5aef48ff065f8919"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 1345;
|
||||
public long DataPoints => 1332;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -195,40 +195,22 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "0.000%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0.528%"},
|
||||
{"Sharpe Ratio", "1.999"},
|
||||
{"Sharpe Ratio", "1.285"},
|
||||
{"Probabilistic Sharpe Ratio", "83.704%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "100%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "0.023"},
|
||||
{"Alpha", "0.015"},
|
||||
{"Beta", "-0.004"},
|
||||
{"Annual Standard Deviation", "0.011"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-4.774"},
|
||||
{"Tracking Error", "0.084"},
|
||||
{"Treynor Ratio", "-4.853"},
|
||||
{"Treynor Ratio", "-3.121"},
|
||||
{"Total Fees", "$4.30"},
|
||||
{"Estimated Strategy Capacity", "$5900000000.00"},
|
||||
{"Lowest Capacity Asset", "ES VMKLFZIH2MTD"},
|
||||
{"Fitness Score", "0.002"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "1792.236"},
|
||||
{"Portfolio Turnover", "0.002"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "0.27%"},
|
||||
{"OrderListHash", "40e4b91ec89383f6501d9ba324e50eb9"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 68645;
|
||||
public long DataPoints => 75401;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -170,40 +170,22 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "4.400%"},
|
||||
{"Expectancy", "-0.724"},
|
||||
{"Net Profit", "-4.430%"},
|
||||
{"Sharpe Ratio", "-31.389"},
|
||||
{"Sharpe Ratio", "-31.63"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "83%"},
|
||||
{"Win Rate", "17%"},
|
||||
{"Profit-Loss Ratio", "0.65"},
|
||||
{"Alpha", "-3.059"},
|
||||
{"Alpha", "-3.065"},
|
||||
{"Beta", "0.128"},
|
||||
{"Annual Standard Deviation", "0.031"},
|
||||
{"Annual Variance", "0.001"},
|
||||
{"Information Ratio", "-81.232"},
|
||||
{"Tracking Error", "0.212"},
|
||||
{"Treynor Ratio", "-7.618"},
|
||||
{"Treynor Ratio", "-7.677"},
|
||||
{"Total Fees", "$6237.00"},
|
||||
{"Estimated Strategy Capacity", "$14000.00"},
|
||||
{"Lowest Capacity Asset", "GC VOFJUCDY9XNH"},
|
||||
{"Fitness Score", "0.001"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "-58.8"},
|
||||
{"Return Over Maximum Drawdown", "-32.114"},
|
||||
{"Portfolio Turnover", "98.477"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "9912.69%"},
|
||||
{"OrderListHash", "8f92e1528c6477a156449fd1e86527e7"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public virtual long DataPoints => 15217;
|
||||
public virtual long DataPoints => 13948;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -129,48 +129,30 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "118"},
|
||||
{"Total Trades", "122"},
|
||||
{"Average Win", "0.09%"},
|
||||
{"Average Loss", "-0.01%"},
|
||||
{"Compounding Annual Return", "-0.479%"},
|
||||
{"Compounding Annual Return", "-0.486%"},
|
||||
{"Drawdown", "0.500%"},
|
||||
{"Expectancy", "-0.835"},
|
||||
{"Net Profit", "-0.483%"},
|
||||
{"Sharpe Ratio", "-1.938"},
|
||||
{"Expectancy", "-0.837"},
|
||||
{"Net Profit", "-0.490%"},
|
||||
{"Sharpe Ratio", "-6.437"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "98%"},
|
||||
{"Win Rate", "2%"},
|
||||
{"Profit-Loss Ratio", "8.76"},
|
||||
{"Alpha", "-0.003"},
|
||||
{"Profit-Loss Ratio", "8.94"},
|
||||
{"Alpha", "-0.011"},
|
||||
{"Beta", "-0.001"},
|
||||
{"Annual Standard Deviation", "0.002"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-1.397"},
|
||||
{"Tracking Error", "0.089"},
|
||||
{"Treynor Ratio", "5.665"},
|
||||
{"Total Fees", "$263.30"},
|
||||
{"Treynor Ratio", "16.362"},
|
||||
{"Total Fees", "$272.54"},
|
||||
{"Estimated Strategy Capacity", "$1000.00"},
|
||||
{"Lowest Capacity Asset", "ES VRJST036ZY0X"},
|
||||
{"Fitness Score", "0.01"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "-1.059"},
|
||||
{"Return Over Maximum Drawdown", "-0.992"},
|
||||
{"Portfolio Turnover", "0.031"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "b75b224669c374dcbacc33f946a1cc7c"}
|
||||
{"Portfolio Turnover", "3.27%"},
|
||||
{"OrderListHash", "61ad5bfa7e2135a85a82c986329335cf"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public virtual long DataPoints => 43786;
|
||||
public virtual long DataPoints => 57752;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -155,40 +155,22 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "4.100%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "-2.169%"},
|
||||
{"Sharpe Ratio", "-10.195"},
|
||||
{"Sharpe Ratio", "-10.299"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "-1.206"},
|
||||
{"Alpha", "-1.212"},
|
||||
{"Beta", "0.238"},
|
||||
{"Annual Standard Deviation", "0.072"},
|
||||
{"Annual Variance", "0.005"},
|
||||
{"Information Ratio", "-15.404"},
|
||||
{"Tracking Error", "0.176"},
|
||||
{"Treynor Ratio", "-3.077"},
|
||||
{"Treynor Ratio", "-3.109"},
|
||||
{"Total Fees", "$4.62"},
|
||||
{"Estimated Strategy Capacity", "$17000000.00"},
|
||||
{"Lowest Capacity Asset", "GC VL5E74HP3EE5"},
|
||||
{"Fitness Score", "0.006"},
|
||||
{"Kelly Criterion Estimate", "-50.022"},
|
||||
{"Kelly Criterion Probability Value", "0.711"},
|
||||
{"Sortino Ratio", "-10.107"},
|
||||
{"Return Over Maximum Drawdown", "-51.815"},
|
||||
{"Portfolio Turnover", "0.54"},
|
||||
{"Total Insights Generated", "5"},
|
||||
{"Total Insights Closed", "4"},
|
||||
{"Total Insights Analysis Completed", "4"},
|
||||
{"Long Insight Count", "5"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$-4434.791"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$-720.6535"},
|
||||
{"Mean Population Estimated Insight Value", "$-180.1634"},
|
||||
{"Mean Population Direction", "25%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "25%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "43.23%"},
|
||||
{"OrderListHash", "323b899ae80aa839e320806411665ce7"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public override long DataPoints => 123753;
|
||||
public override long DataPoints => 163392;
|
||||
|
||||
/// <summary>
|
||||
/// This is used by the regression test system to indicate what the expected statistics are from running the algorithm
|
||||
@@ -55,40 +55,22 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "5.000%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "-3.314%"},
|
||||
{"Sharpe Ratio", "-6.303"},
|
||||
{"Sharpe Ratio", "-6.359"},
|
||||
{"Probabilistic Sharpe Ratio", "9.333%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "-1.465"},
|
||||
{"Alpha", "-1.47"},
|
||||
{"Beta", "0.312"},
|
||||
{"Annual Standard Deviation", "0.134"},
|
||||
{"Annual Variance", "0.018"},
|
||||
{"Information Ratio", "-14.77"},
|
||||
{"Tracking Error", "0.192"},
|
||||
{"Treynor Ratio", "-2.718"},
|
||||
{"Treynor Ratio", "-2.742"},
|
||||
{"Total Fees", "$4.62"},
|
||||
{"Estimated Strategy Capacity", "$52000000.00"},
|
||||
{"Lowest Capacity Asset", "GC VL5E74HP3EE5"},
|
||||
{"Fitness Score", "0.009"},
|
||||
{"Kelly Criterion Estimate", "-112.972"},
|
||||
{"Kelly Criterion Probability Value", "0.671"},
|
||||
{"Sortino Ratio", "-8.421"},
|
||||
{"Return Over Maximum Drawdown", "-35.2"},
|
||||
{"Portfolio Turnover", "0.548"},
|
||||
{"Total Insights Generated", "6"},
|
||||
{"Total Insights Closed", "5"},
|
||||
{"Total Insights Analysis Completed", "5"},
|
||||
{"Long Insight Count", "6"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$-96.12923"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$-15.621"},
|
||||
{"Mean Population Estimated Insight Value", "$-3.1242"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "43.77%"},
|
||||
{"OrderListHash", "18ffd3a774c68da83d867e3b09e3e05d"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -140,12 +140,12 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public virtual long DataPoints => 44184;
|
||||
public virtual long DataPoints => 48688;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
/// </summary>
|
||||
public virtual int AlgorithmHistoryDataPoints => 4818;
|
||||
public virtual int AlgorithmHistoryDataPoints => 5305;
|
||||
|
||||
/// <summary>
|
||||
/// This is used by the regression test system to indicate what the expected statistics are from running the algorithm
|
||||
@@ -174,25 +174,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", ""},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "79228162514264337593543950335"},
|
||||
{"Portfolio Turnover", "0"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "0%"},
|
||||
{"OrderListHash", "d41d8cd98f00b204e9800998ecf8427e"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -47,12 +47,12 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public override long DataPoints => 134096;
|
||||
public override long DataPoints => 147769;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
/// </summary>
|
||||
public override int AlgorithmHistoryDataPoints => 5539;
|
||||
public override int AlgorithmHistoryDataPoints => 6112;
|
||||
|
||||
/// <summary>
|
||||
/// This is used by the regression test system to indicate what the expected statistics are from running the algorithm
|
||||
@@ -81,25 +81,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", ""},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "79228162514264337593543950335"},
|
||||
{"Portfolio Turnover", "0"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "0%"},
|
||||
{"OrderListHash", "d41d8cd98f00b204e9800998ecf8427e"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -41,55 +41,37 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public override long DataPoints => 96027;
|
||||
public override long DataPoints => 86963;
|
||||
|
||||
/// <summary>
|
||||
/// This is used by the regression test system to indicate what the expected statistics are from running the algorithm
|
||||
/// </summary>
|
||||
public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "638"},
|
||||
{"Total Trades", "636"},
|
||||
{"Average Win", "0.02%"},
|
||||
{"Average Loss", "-0.01%"},
|
||||
{"Compounding Annual Return", "-1.610%"},
|
||||
{"Compounding Annual Return", "-1.606%"},
|
||||
{"Drawdown", "1.600%"},
|
||||
{"Expectancy", "-0.841"},
|
||||
{"Net Profit", "-1.622%"},
|
||||
{"Sharpe Ratio", "-5.105"},
|
||||
{"Net Profit", "-1.617%"},
|
||||
{"Sharpe Ratio", "-8.774"},
|
||||
{"Probabilistic Sharpe Ratio", "0.000%"},
|
||||
{"Loss Rate", "96%"},
|
||||
{"Win Rate", "4%"},
|
||||
{"Profit-Loss Ratio", "3.21"},
|
||||
{"Alpha", "-0.01"},
|
||||
{"Alpha", "-0.017"},
|
||||
{"Beta", "-0.003"},
|
||||
{"Annual Standard Deviation", "0.002"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-1.473"},
|
||||
{"Tracking Error", "0.089"},
|
||||
{"Treynor Ratio", "3.179"},
|
||||
{"Total Fees", "$1456.18"},
|
||||
{"Estimated Strategy Capacity", "$6000.00"},
|
||||
{"Treynor Ratio", "5.404"},
|
||||
{"Total Fees", "$1451.88"},
|
||||
{"Estimated Strategy Capacity", "$9000.00"},
|
||||
{"Lowest Capacity Asset", "ES VP274HSU1AF5"},
|
||||
{"Fitness Score", "0.045"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "-4.328"},
|
||||
{"Return Over Maximum Drawdown", "-0.995"},
|
||||
{"Portfolio Turnover", "0.205"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "8842e0b890f721371ebf3c25328dee5b"}
|
||||
{"Portfolio Turnover", "17.86%"},
|
||||
{"OrderListHash", "de6a834d1b5e7aeb40f6cf9dba16782d"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 204087;
|
||||
public long DataPoints => 224660;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -170,40 +170,22 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "13.900%"},
|
||||
{"Expectancy", "-0.824"},
|
||||
{"Net Profit", "-13.874%"},
|
||||
{"Sharpe Ratio", "-19.202"},
|
||||
{"Sharpe Ratio", "-19.346"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "89%"},
|
||||
{"Win Rate", "11%"},
|
||||
{"Profit-Loss Ratio", "0.64"},
|
||||
{"Alpha", "2.477"},
|
||||
{"Alpha", "2.468"},
|
||||
{"Beta", "-0.215"},
|
||||
{"Annual Standard Deviation", "0.052"},
|
||||
{"Annual Variance", "0.003"},
|
||||
{"Information Ratio", "-58.37"},
|
||||
{"Tracking Error", "0.295"},
|
||||
{"Treynor Ratio", "4.66"},
|
||||
{"Treynor Ratio", "4.695"},
|
||||
{"Total Fees", "$19131.42"},
|
||||
{"Estimated Strategy Capacity", "$130000.00"},
|
||||
{"Lowest Capacity Asset", "GC VOFJUCDY9XNH"},
|
||||
{"Fitness Score", "0.032"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "-9.217"},
|
||||
{"Return Over Maximum Drawdown", "-7.692"},
|
||||
{"Portfolio Turnover", "304.869"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "32523.20%"},
|
||||
{"OrderListHash", "85cdd035d7c7a3da178d1c2dff31f1bd"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public override long DataPoints => 17431;
|
||||
public override long DataPoints => 16247;
|
||||
|
||||
/// <summary>
|
||||
/// This is used by the regression test system to indicate what the expected statistics are from running the algorithm
|
||||
@@ -57,41 +57,23 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "0.600%"},
|
||||
{"Expectancy", "-0.872"},
|
||||
{"Net Profit", "-0.649%"},
|
||||
{"Sharpe Ratio", "-2.343"},
|
||||
{"Sharpe Ratio", "-6.343"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "99%"},
|
||||
{"Win Rate", "1%"},
|
||||
{"Profit-Loss Ratio", "8.76"},
|
||||
{"Alpha", "-0.004"},
|
||||
{"Alpha", "-0.012"},
|
||||
{"Beta", "-0.001"},
|
||||
{"Annual Standard Deviation", "0.002"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-1.409"},
|
||||
{"Tracking Error", "0.089"},
|
||||
{"Treynor Ratio", "3.618"},
|
||||
{"Treynor Ratio", "10.18"},
|
||||
{"Total Fees", "$338.96"},
|
||||
{"Estimated Strategy Capacity", "$1000.00"},
|
||||
{"Lowest Capacity Asset", "ES VRJST036ZY0X"},
|
||||
{"Fitness Score", "0.013"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "-1.464"},
|
||||
{"Return Over Maximum Drawdown", "-0.992"},
|
||||
{"Portfolio Turnover", "0.04"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "48bfc4d255420cb589e00cf582554e0a"}
|
||||
{"Portfolio Turnover", "4.07%"},
|
||||
{"OrderListHash", "e2d7f858dcad2d760f776bec1065b2f1"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,55 +41,37 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public override long DataPoints => 248521;
|
||||
public override long DataPoints => 227220;
|
||||
|
||||
/// <summary>
|
||||
/// This is used by the regression test system to indicate what the expected statistics are from running the algorithm
|
||||
/// </summary>
|
||||
public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "1982"},
|
||||
{"Total Trades", "1970"},
|
||||
{"Average Win", "0.01%"},
|
||||
{"Average Loss", "-0.01%"},
|
||||
{"Compounding Annual Return", "-4.666%"},
|
||||
{"Compounding Annual Return", "-4.641%"},
|
||||
{"Drawdown", "4.700%"},
|
||||
{"Expectancy", "-0.911"},
|
||||
{"Net Profit", "-4.700%"},
|
||||
{"Sharpe Ratio", "-5.792"},
|
||||
{"Net Profit", "-4.675%"},
|
||||
{"Sharpe Ratio", "-7.136"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "97%"},
|
||||
{"Win Rate", "3%"},
|
||||
{"Profit-Loss Ratio", "2.04"},
|
||||
{"Alpha", "-0.031"},
|
||||
{"Alpha", "-0.038"},
|
||||
{"Beta", "-0.008"},
|
||||
{"Annual Standard Deviation", "0.005"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-1.701"},
|
||||
{"Information Ratio", "-1.699"},
|
||||
{"Tracking Error", "0.09"},
|
||||
{"Treynor Ratio", "4.096"},
|
||||
{"Total Fees", "$4521.78"},
|
||||
{"Estimated Strategy Capacity", "$2000.00"},
|
||||
{"Treynor Ratio", "5.039"},
|
||||
{"Total Fees", "$4495.98"},
|
||||
{"Estimated Strategy Capacity", "$3000.00"},
|
||||
{"Lowest Capacity Asset", "ES VP274HSU1AF5"},
|
||||
{"Fitness Score", "0.131"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "-6.211"},
|
||||
{"Return Over Maximum Drawdown", "-0.995"},
|
||||
{"Portfolio Turnover", "0.649"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "2402a307b20aee195b77b8478d7ca64d"}
|
||||
{"Portfolio Turnover", "56.20%"},
|
||||
{"OrderListHash", "e65e1dace0d1679c2026155628ca3077"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "2.000%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "1.529%"},
|
||||
{"Sharpe Ratio", "8.889"},
|
||||
{"Sharpe Ratio", "8.855"},
|
||||
{"Probabilistic Sharpe Ratio", "67.609%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -105,29 +105,11 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Annual Variance", "0.049"},
|
||||
{"Information Ratio", "-14.564"},
|
||||
{"Tracking Error", "0.001"},
|
||||
{"Treynor Ratio", "1.978"},
|
||||
{"Treynor Ratio", "1.971"},
|
||||
{"Total Fees", "$3.44"},
|
||||
{"Estimated Strategy Capacity", "$110000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.247"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "12.105"},
|
||||
{"Return Over Maximum Drawdown", "112.047"},
|
||||
{"Portfolio Turnover", "0.249"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "19.96%"},
|
||||
{"OrderListHash", "f409be3a7c63d9c1394c2e6c005a15ee"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -125,47 +125,29 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "3"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "-2.45%"},
|
||||
{"Compounding Annual Return", "-62.036%"},
|
||||
{"Drawdown", "9.300%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "-3.051%"},
|
||||
{"Sharpe Ratio", "-4.466"},
|
||||
{"Probabilistic Sharpe Ratio", "0.781%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Average Win", "6.15%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "435.569%"},
|
||||
{"Drawdown", "3.400%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "5.516%"},
|
||||
{"Sharpe Ratio", "-6.336"},
|
||||
{"Probabilistic Sharpe Ratio", "0.011%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "100%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "-0.172"},
|
||||
{"Beta", "0.076"},
|
||||
{"Annual Standard Deviation", "0.029"},
|
||||
{"Alpha", "-0.226"},
|
||||
{"Beta", "0.02"},
|
||||
{"Annual Standard Deviation", "0.034"},
|
||||
{"Annual Variance", "0.001"},
|
||||
{"Information Ratio", "-6.723"},
|
||||
{"Tracking Error", "0.099"},
|
||||
{"Treynor Ratio", "-1.733"},
|
||||
{"Information Ratio", "-7.032"},
|
||||
{"Tracking Error", "0.107"},
|
||||
{"Treynor Ratio", "-10.906"},
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$9100000.00"},
|
||||
{"Estimated Strategy Capacity", "$3000.00"},
|
||||
{"Lowest Capacity Asset", "SPX XL80P3GHDZXQ|SPX 31"},
|
||||
{"Fitness Score", "0.025"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "-3.11"},
|
||||
{"Return Over Maximum Drawdown", "-21.007"},
|
||||
{"Portfolio Turnover", "0.332"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "905811fc779835bf0c514963a20e40f9"}
|
||||
{"Portfolio Turnover", "24.07%"},
|
||||
{"OrderListHash", "5dbee236086bb2c39e2fbeac068280fd"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,40 +42,22 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "1.800%"},
|
||||
{"Expectancy", "-0.402"},
|
||||
{"Net Profit", "-0.922%"},
|
||||
{"Sharpe Ratio", "-2.856"},
|
||||
{"Sharpe Ratio", "-2.903"},
|
||||
{"Probabilistic Sharpe Ratio", "22.230%"},
|
||||
{"Loss Rate", "97%"},
|
||||
{"Win Rate", "3%"},
|
||||
{"Profit-Loss Ratio", "19.95"},
|
||||
{"Alpha", "-0.155"},
|
||||
{"Alpha", "-0.157"},
|
||||
{"Beta", "0.025"},
|
||||
{"Annual Standard Deviation", "0.053"},
|
||||
{"Annual Variance", "0.003"},
|
||||
{"Information Ratio", "-2.07"},
|
||||
{"Tracking Error", "0.121"},
|
||||
{"Treynor Ratio", "-6.089"},
|
||||
{"Treynor Ratio", "-6.189"},
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$200000.00"},
|
||||
{"Estimated Strategy Capacity", "$300000.00"},
|
||||
{"Lowest Capacity Asset", "SPX XL80P3GHDZXQ|SPX 31"},
|
||||
{"Fitness Score", "0.01"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "-6.834"},
|
||||
{"Return Over Maximum Drawdown", "-10.862"},
|
||||
{"Portfolio Turnover", "0.327"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "24.63%"},
|
||||
{"OrderListHash", "9e974939d13fd3255c6291a65d2c1eb9"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -57,40 +57,22 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "0.000%"},
|
||||
{"Expectancy", "-0.486"},
|
||||
{"Net Profit", "0.000%"},
|
||||
{"Sharpe Ratio", "-1.628"},
|
||||
{"Sharpe Ratio", "-101.77"},
|
||||
{"Probabilistic Sharpe Ratio", "17.439%"},
|
||||
{"Loss Rate", "97%"},
|
||||
{"Win Rate", "3%"},
|
||||
{"Profit-Loss Ratio", "17.50"},
|
||||
{"Alpha", "-0"},
|
||||
{"Alpha", "-0.003"},
|
||||
{"Beta", "-0"},
|
||||
{"Annual Standard Deviation", "0"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-0.449"},
|
||||
{"Tracking Error", "0.138"},
|
||||
{"Treynor Ratio", "1.87"},
|
||||
{"Treynor Ratio", "116.921"},
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", "SPX XL80P59H5E6M|SPX 31"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "-206998.942"},
|
||||
{"Return Over Maximum Drawdown", "-5.808"},
|
||||
{"Portfolio Turnover", "0"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "0.00%"},
|
||||
{"OrderListHash", "0df3713aeb32e9c0738200f2a109e2f9"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "0.000%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "-0.008%"},
|
||||
{"Sharpe Ratio", "-1.183"},
|
||||
{"Sharpe Ratio", "-497.389"},
|
||||
{"Probabilistic Sharpe Ratio", "0.001%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -119,25 +119,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Fees", "₹6.00"},
|
||||
{"Estimated Strategy Capacity", "₹61000000000.00"},
|
||||
{"Lowest Capacity Asset", "YESBANK UL"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "-0.247"},
|
||||
{"Return Over Maximum Drawdown", "-1.104"},
|
||||
{"Portfolio Turnover", "0"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "₹0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "₹0"},
|
||||
{"Mean Population Estimated Insight Value", "₹0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "0.00%"},
|
||||
{"OrderListHash", "6cc69218edd7bd461678b9ee0c575db5"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -124,11 +124,11 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Trades", "6"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0.00%"},
|
||||
{"Compounding Annual Return", "-0.395%"},
|
||||
{"Compounding Annual Return", "-0.386%"},
|
||||
{"Drawdown", "0.000%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "-0.004%"},
|
||||
{"Sharpe Ratio", "-23.595"},
|
||||
{"Sharpe Ratio", "-328.371"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -141,28 +141,10 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Tracking Error", "0"},
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "₹36.00"},
|
||||
{"Estimated Strategy Capacity", "₹74000.00"},
|
||||
{"Estimated Strategy Capacity", "₹84000.00"},
|
||||
{"Lowest Capacity Asset", "JUNIORBEES UL"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "-29.6"},
|
||||
{"Return Over Maximum Drawdown", "-123.624"},
|
||||
{"Portfolio Turnover", "0"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "₹0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "₹0"},
|
||||
{"Mean Population Estimated Insight Value", "₹0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "4637f26543287548b28a3c296db055d3"}
|
||||
{"Portfolio Turnover", "0.04%"},
|
||||
{"OrderListHash", "57558324bc9b67b36ae33c3e1c191740"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,29 +133,11 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Information Ratio", "0"},
|
||||
{"Tracking Error", "0"},
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$7.50"},
|
||||
{"Estimated Strategy Capacity", "$84000.00"},
|
||||
{"Total Fees", "$26.00"},
|
||||
{"Estimated Strategy Capacity", "$70000.00"},
|
||||
{"Lowest Capacity Asset", "GOOCV W78ZERHAOVVQ|GOOCV VP83T1ZUHROL"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Return Over Maximum Drawdown", "0"},
|
||||
{"Portfolio Turnover", "0"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "92610619a10e30863020cc84aa30be3b"}
|
||||
{"Portfolio Turnover", "61.31%"},
|
||||
{"OrderListHash", "cee5cc2b0f80c308b496cac0b8668163"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 476196;
|
||||
public long DataPoints => 475777;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -143,29 +143,11 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Information Ratio", "0"},
|
||||
{"Tracking Error", "0"},
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$418.00"},
|
||||
{"Total Fees", "$543.40"},
|
||||
{"Estimated Strategy Capacity", "$3000.00"},
|
||||
{"Lowest Capacity Asset", "GOOCV W78ZFMEBBB2E|GOOCV VP83T1ZUHROL"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Return Over Maximum Drawdown", "0"},
|
||||
{"Portfolio Turnover", "0"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "7bd09d7b4f8da2b9f594ce077cd6f0ee"}
|
||||
{"Portfolio Turnover", "338.60%"},
|
||||
{"OrderListHash", "e0289a2989c91934656ff7e578f5e810"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,25 +143,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Fees", "$2.00"},
|
||||
{"Estimated Strategy Capacity", "$1300000.00"},
|
||||
{"Lowest Capacity Asset", "GOOCV 30AKMEIPOSS1Y|GOOCV VP83T1ZUHROL"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Return Over Maximum Drawdown", "0"},
|
||||
{"Portfolio Turnover", "0"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "10.71%"},
|
||||
{"OrderListHash", "838e313ba57850227ec810ed8fb85a23"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
var contractsByExpiration = chain.Where(x => x.Expiry != Time.Date).OrderBy(x => x.Expiry);
|
||||
var contract = contractsByExpiration.FirstOrDefault();
|
||||
|
||||
if (contract != null && IsMarketOpen(contract.Symbol))
|
||||
if (contract != null)
|
||||
{
|
||||
// if found, trade it
|
||||
MarketOrder(contract.Symbol, 1);
|
||||
@@ -122,7 +122,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 39654;
|
||||
public long DataPoints => 36834;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -141,7 +141,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "1.300%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "-1.311%"},
|
||||
{"Sharpe Ratio", "-3.31"},
|
||||
{"Sharpe Ratio", "-3.607"},
|
||||
{"Probabilistic Sharpe Ratio", "0.035%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -154,27 +154,9 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Tracking Error", "0.034"},
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$1.00"},
|
||||
{"Estimated Strategy Capacity", "$18000.00"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", "GOOCV W78ZFMML01JA|GOOCV VP83T1ZUHROL"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "-1.496"},
|
||||
{"Return Over Maximum Drawdown", "-11.673"},
|
||||
{"Portfolio Turnover", "0"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "0.05%"},
|
||||
{"OrderListHash", "0b52bbe98ade8e3aab943e64fcf4abfe"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 1322413;
|
||||
public long DataPoints => 1253773;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -134,25 +134,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Fees", "$1.00"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", "GOOCV VP83T1ZUHROL"},
|
||||
{"Fitness Score", "0.188"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "-73.268"},
|
||||
{"Portfolio Turnover", "0.376"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "15.08%"},
|
||||
{"OrderListHash", "0f8537495f5744c02191656d6b3f9205"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 990979;
|
||||
public long DataPoints => 993927;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -156,14 +156,14 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Average Loss", "-0.28%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
{"Drawdown", "385.400%"},
|
||||
{"Expectancy", "-0.249"},
|
||||
{"Expectancy", "0.502"},
|
||||
{"Net Profit", "-386.489%"},
|
||||
{"Sharpe Ratio", "-0.033"},
|
||||
{"Probabilistic Sharpe Ratio", "1.235%"},
|
||||
{"Loss Rate", "50%"},
|
||||
{"Win Rate", "50%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "100%"},
|
||||
{"Profit-Loss Ratio", "0.50"},
|
||||
{"Alpha", "-95.983"},
|
||||
{"Alpha", "-94.012"},
|
||||
{"Beta", "263.726"},
|
||||
{"Annual Standard Deviation", "30.617"},
|
||||
{"Annual Variance", "937.371"},
|
||||
@@ -173,25 +173,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Fees", "$3.00"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", "AAPL R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.168"},
|
||||
{"Kelly Criterion Estimate", "0.327"},
|
||||
{"Kelly Criterion Probability Value", "1"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "0"},
|
||||
{"Portfolio Turnover", "0.224"},
|
||||
{"Total Insights Generated", "28"},
|
||||
{"Total Insights Closed", "24"},
|
||||
{"Total Insights Analysis Completed", "24"},
|
||||
{"Long Insight Count", "28"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$13.64796"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$1.89555"},
|
||||
{"Mean Population Estimated Insight Value", "$0.07898125"},
|
||||
{"Mean Population Direction", "50%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "50.0482%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "13.46%"},
|
||||
{"OrderListHash", "83c9fb13ee32284702779eff8d11c608"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -128,40 +128,22 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "0.200%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "-0.134%"},
|
||||
{"Sharpe Ratio", "-8.839"},
|
||||
{"Sharpe Ratio", "-9.78"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "0.083"},
|
||||
{"Alpha", "0.075"},
|
||||
{"Beta", "-0.054"},
|
||||
{"Annual Standard Deviation", "0.008"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-18.699"},
|
||||
{"Tracking Error", "0.155"},
|
||||
{"Treynor Ratio", "1.296"},
|
||||
{"Treynor Ratio", "1.434"},
|
||||
{"Total Fees", "$4.00"},
|
||||
{"Estimated Strategy Capacity", "$1000.00"},
|
||||
{"Lowest Capacity Asset", "AAPL 2ZTXYMUAHCIAU|AAPL R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.04"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "-118.28"},
|
||||
{"Portfolio Turnover", "0.081"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "2.28%"},
|
||||
{"OrderListHash", "81e8a822d43de2165c1d3f52964ec312"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public virtual long DataPoints => 66015;
|
||||
public virtual long DataPoints => 65536;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -122,42 +122,24 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Average Loss", "-0.69%"},
|
||||
{"Compounding Annual Return", "58.005%"},
|
||||
{"Drawdown", "0.400%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Expectancy", "-0.5"},
|
||||
{"Net Profit", "0.588%"},
|
||||
{"Sharpe Ratio", "1.448"},
|
||||
{"Sharpe Ratio", "0.836"},
|
||||
{"Probabilistic Sharpe Ratio", "51.980%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Loss Rate", "50%"},
|
||||
{"Win Rate", "50%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "0.288"},
|
||||
{"Alpha", "0.286"},
|
||||
{"Beta", "-0.04"},
|
||||
{"Annual Standard Deviation", "0.004"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-98.963"},
|
||||
{"Tracking Error", "0.072"},
|
||||
{"Treynor Ratio", "-0.149"},
|
||||
{"Treynor Ratio", "-0.086"},
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$8400000.00"},
|
||||
{"Estimated Strategy Capacity", "$580000.00"},
|
||||
{"Lowest Capacity Asset", "SPXW 31K54PVWHUJHQ|SPX 31"},
|
||||
{"Fitness Score", "0.006"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "496.165"},
|
||||
{"Return Over Maximum Drawdown", "1786.884"},
|
||||
{"Portfolio Turnover", "0.006"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "0.48%"},
|
||||
{"OrderListHash", "174bd0a99916d58ca3f12139306940db"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public virtual long DataPoints => 35811;
|
||||
public virtual long DataPoints => 35451;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -122,47 +122,29 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "4"},
|
||||
{"Average Win", "0.46%"},
|
||||
{"Average Win", "0.12%"},
|
||||
{"Average Loss", "0.00%"},
|
||||
{"Compounding Annual Return", "41.434%"},
|
||||
{"Compounding Annual Return", "8.975%"},
|
||||
{"Drawdown", "0.100%"},
|
||||
{"Expectancy", "115.281"},
|
||||
{"Net Profit", "0.445%"},
|
||||
{"Sharpe Ratio", "-7.925"},
|
||||
{"Expectancy", "62.078"},
|
||||
{"Net Profit", "0.110%"},
|
||||
{"Sharpe Ratio", "-14.495"},
|
||||
{"Probabilistic Sharpe Ratio", "1.216%"},
|
||||
{"Loss Rate", "50%"},
|
||||
{"Win Rate", "50%"},
|
||||
{"Profit-Loss Ratio", "231.56"},
|
||||
{"Alpha", "-0.012"},
|
||||
{"Profit-Loss Ratio", "125.16"},
|
||||
{"Alpha", "-0.014"},
|
||||
{"Beta", "0.001"},
|
||||
{"Annual Standard Deviation", "0"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-103.222"},
|
||||
{"Information Ratio", "-103.223"},
|
||||
{"Tracking Error", "0.069"},
|
||||
{"Treynor Ratio", "-2.449"},
|
||||
{"Treynor Ratio", "-4.479"},
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$4100000.00"},
|
||||
{"Estimated Strategy Capacity", "$1800000.00"},
|
||||
{"Lowest Capacity Asset", "SPXW XKX6S2GM9PGU|SPX 31"},
|
||||
{"Fitness Score", "0.001"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "79228162514264337593543950335"},
|
||||
{"Portfolio Turnover", "0.001"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "4adb43a8298b9192e0f45d2ef1e5d370"}
|
||||
{"Portfolio Turnover", "0.03%"},
|
||||
{"OrderListHash", "38db27781e4df93687d0895df9796c7d"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace QuantConnect.Algorithm.CSharp.Benchmarks
|
||||
"OSCR", "WOLF", "SYF", "GOGL", "HES", "PHM", "CWEB", "ALDX", "BTWN", "AFL", "PPL", "CIM"
|
||||
|
||||
};
|
||||
Settings.DataSubscriptionLimit = 1000000;
|
||||
|
||||
SetWarmUp(TimeSpan.FromDays(1));
|
||||
foreach(var ticker in equity_symbols)
|
||||
{
|
||||
|
||||
@@ -75,25 +75,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Fees", "₮45.62"},
|
||||
{"Estimated Strategy Capacity", "₮220000.00"},
|
||||
{"Lowest Capacity Asset", "BTCUSDT 18N"},
|
||||
{"Fitness Score", "0.208"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "26.189"},
|
||||
{"Portfolio Turnover", "0.208"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "₮0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "₮0"},
|
||||
{"Mean Population Estimated Insight Value", "₮0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "22.80%"},
|
||||
{"OrderListHash", "7417649395922ff3791471b4f3b5c021"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -75,25 +75,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Fees", "₮45.62"},
|
||||
{"Estimated Strategy Capacity", "₮12000000.00"},
|
||||
{"Lowest Capacity Asset", "BTCUSDT 18N"},
|
||||
{"Fitness Score", "0.208"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "26.189"},
|
||||
{"Portfolio Turnover", "0.208"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "₮0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "₮0"},
|
||||
{"Mean Population Estimated Insight Value", "₮0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "22.80%"},
|
||||
{"OrderListHash", "7417649395922ff3791471b4f3b5c021"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -74,25 +74,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Fees", "$1.13"},
|
||||
{"Estimated Strategy Capacity", "$2000.00"},
|
||||
{"Lowest Capacity Asset", "BTCUSD E3"},
|
||||
{"Fitness Score", "0.002"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "79228162514264337593543950335"},
|
||||
{"Portfolio Turnover", "0.002"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "0.28%"},
|
||||
{"OrderListHash", "7f892f0c42d8826ff770ee602fe207a2"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -74,25 +74,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Fees", "$1.13"},
|
||||
{"Estimated Strategy Capacity", "$640000.00"},
|
||||
{"Lowest Capacity Asset", "BTCUSD E3"},
|
||||
{"Fitness Score", "0.002"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "79228162514264337593543950335"},
|
||||
{"Portfolio Turnover", "0.002"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "0.28%"},
|
||||
{"OrderListHash", "7f892f0c42d8826ff770ee602fe207a2"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -88,48 +88,30 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "20"},
|
||||
{"Total Trades", "14"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "-0.13%"},
|
||||
{"Compounding Annual Return", "62.435%"},
|
||||
{"Average Loss", "-0.23%"},
|
||||
{"Compounding Annual Return", "63.336%"},
|
||||
{"Drawdown", "1.100%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "0.667%"},
|
||||
{"Sharpe Ratio", "3.993"},
|
||||
{"Probabilistic Sharpe Ratio", "58.777%"},
|
||||
{"Net Profit", "0.674%"},
|
||||
{"Sharpe Ratio", "3.986"},
|
||||
{"Probabilistic Sharpe Ratio", "58.892%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "-0.598"},
|
||||
{"Beta", "0.569"},
|
||||
{"Alpha", "-0.595"},
|
||||
{"Beta", "0.57"},
|
||||
{"Annual Standard Deviation", "0.133"},
|
||||
{"Annual Variance", "0.018"},
|
||||
{"Information Ratio", "-13.973"},
|
||||
{"Information Ratio", "-13.918"},
|
||||
{"Tracking Error", "0.104"},
|
||||
{"Treynor Ratio", "0.932"},
|
||||
{"Total Fees", "$46.20"},
|
||||
{"Estimated Strategy Capacity", "$2300000.00"},
|
||||
{"Treynor Ratio", "0.93"},
|
||||
{"Total Fees", "$40.20"},
|
||||
{"Estimated Strategy Capacity", "$4400000.00"},
|
||||
{"Lowest Capacity Asset", "AIG R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.645"},
|
||||
{"Kelly Criterion Estimate", "13.787"},
|
||||
{"Kelly Criterion Probability Value", "0.231"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "65.642"},
|
||||
{"Portfolio Turnover", "0.645"},
|
||||
{"Total Insights Generated", "13"},
|
||||
{"Total Insights Closed", "10"},
|
||||
{"Total Insights Analysis Completed", "10"},
|
||||
{"Long Insight Count", "6"},
|
||||
{"Short Insight Count", "7"},
|
||||
{"Long/Short Ratio", "85.71%"},
|
||||
{"Estimated Monthly Alpha Value", "$52003.0716"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$8956.0846"},
|
||||
{"Mean Population Estimated Insight Value", "$895.6085"},
|
||||
{"Mean Population Direction", "70%"},
|
||||
{"Mean Population Magnitude", "70%"},
|
||||
{"Rolling Averaged Population Direction", "94.5154%"},
|
||||
{"Rolling Averaged Population Magnitude", "94.5154%"},
|
||||
{"OrderListHash", "0945ff7a39bb8f8a07b3dcc817c070aa"}
|
||||
{"Portfolio Turnover", "64.47%"},
|
||||
{"OrderListHash", "7e43a08e470a1709c7f7066d6ed1d445"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
75
Algorithm.CSharp/BrokerageActivityEventHandlingAlgorithm.cs
Normal file
75
Algorithm.CSharp/BrokerageActivityEventHandlingAlgorithm.cs
Normal file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
|
||||
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
using QuantConnect.Brokerages;
|
||||
using QuantConnect.Data;
|
||||
|
||||
namespace QuantConnect.Algorithm.CSharp
|
||||
{
|
||||
/// <summary>
|
||||
/// Example algorithm to demostrate the event handlers of Brokerage activities
|
||||
/// </summary>
|
||||
/// <meta name="tag" content="using quantconnect" />
|
||||
public class BrokerageActivityEventHandlingAlgorithm : QCAlgorithm
|
||||
{
|
||||
/// <summary>
|
||||
/// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.
|
||||
/// </summary>
|
||||
public override void Initialize()
|
||||
{
|
||||
SetStartDate(2013, 10, 07);
|
||||
SetEndDate(2013, 10, 11);
|
||||
SetCash(100000);
|
||||
|
||||
AddEquity("SPY", Resolution.Minute);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
|
||||
/// </summary>
|
||||
/// <param name="data">Slice object keyed by symbol containing the stock data</param>
|
||||
public override void OnData(Slice data)
|
||||
{
|
||||
if (!Portfolio.Invested)
|
||||
{
|
||||
SetHoldings("SPY", 1);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Brokerage message event handler. This method is called for all types of brokerage messages.
|
||||
/// </summary>
|
||||
public override void OnBrokerageMessage(BrokerageMessageEvent messageEvent)
|
||||
{
|
||||
Debug($"Brokerage meesage received - {messageEvent.ToString()}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Brokerage disconnected event handler. This method is called when the brokerage connection is lost.
|
||||
/// </summary>
|
||||
public override void OnBrokerageDisconnect()
|
||||
{
|
||||
Debug($"Brokerage disconnected!");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Brokerage reconnected event handler. This method is called when the brokerage connection is restored after a disconnection.
|
||||
/// </summary>
|
||||
public override void OnBrokerageReconnect()
|
||||
{
|
||||
Debug($"Brokerage reconnected!");
|
||||
}
|
||||
}
|
||||
}
|
||||
262
Algorithm.CSharp/BybitCryptoFuturesRegressionAlgorithm.cs
Normal file
262
Algorithm.CSharp/BybitCryptoFuturesRegressionAlgorithm.cs
Normal file
@@ -0,0 +1,262 @@
|
||||
/*
|
||||
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
|
||||
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using QuantConnect.Data;
|
||||
using QuantConnect.Brokerages;
|
||||
using QuantConnect.Indicators;
|
||||
using QuantConnect.Orders;
|
||||
using QuantConnect.Interfaces;
|
||||
using QuantConnect.Securities.CryptoFuture;
|
||||
using QuantConnect.Data.Market;
|
||||
using QuantConnect.Securities;
|
||||
using System.Linq;
|
||||
|
||||
namespace QuantConnect.Algorithm.CSharp
|
||||
{
|
||||
/// <summary>
|
||||
/// Algorithm demonstrating and ensuring that Bybit crypto futures brokerage model works as expected
|
||||
/// </summary>
|
||||
public class BybitCryptoFuturesRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition
|
||||
{
|
||||
private CryptoFuture _btcUsdt;
|
||||
private CryptoFuture _btcUsd;
|
||||
|
||||
private ExponentialMovingAverage _fast;
|
||||
private ExponentialMovingAverage _slow;
|
||||
|
||||
private Dictionary<Symbol, int> _interestPerSymbol = new();
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
SetStartDate(2022, 12, 13);
|
||||
SetEndDate(2022, 12, 13);
|
||||
|
||||
// Set strategy cash (USD)
|
||||
SetCash(100000);
|
||||
|
||||
SetBrokerageModel(BrokerageName.Bybit, AccountType.Margin);
|
||||
|
||||
AddCrypto("BTCUSDT", Resolution.Minute);
|
||||
|
||||
_btcUsdt = AddCryptoFuture("BTCUSDT", Resolution.Minute);
|
||||
_btcUsd = AddCryptoFuture("BTCUSD", Resolution.Minute);
|
||||
|
||||
// create two moving averages
|
||||
_fast = EMA(_btcUsdt.Symbol, 30, Resolution.Minute);
|
||||
_slow = EMA(_btcUsdt.Symbol, 60, Resolution.Minute);
|
||||
|
||||
_interestPerSymbol[_btcUsdt.Symbol] = 0;
|
||||
_interestPerSymbol[_btcUsd.Symbol] = 0;
|
||||
|
||||
// the amount of USDT we need to hold to trade 'BTCUSDT'
|
||||
_btcUsdt.QuoteCurrency.SetAmount(200);
|
||||
// the amount of BTC we need to hold to trade 'BTCUSD'
|
||||
_btcUsd.BaseCurrency.SetAmount(0.005m);
|
||||
}
|
||||
|
||||
public override void OnData(Slice data)
|
||||
{
|
||||
var interestRates = data.Get<MarginInterestRate>();
|
||||
foreach (var interestRate in interestRates)
|
||||
{
|
||||
_interestPerSymbol[interestRate.Key]++;
|
||||
|
||||
var cachedInterestRate = Securities[interestRate.Key].Cache.GetData<MarginInterestRate>();
|
||||
if (cachedInterestRate != interestRate.Value)
|
||||
{
|
||||
throw new Exception($"Unexpected cached margin interest rate for {interestRate.Key}!");
|
||||
}
|
||||
}
|
||||
|
||||
if (!_slow.IsReady)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_fast > _slow)
|
||||
{
|
||||
if (!Portfolio.Invested && Transactions.OrdersCount == 0)
|
||||
{
|
||||
var ticket = Buy(_btcUsd.Symbol, 1000);
|
||||
if (ticket.Status != OrderStatus.Invalid)
|
||||
{
|
||||
throw new Exception($"Unexpected valid order {ticket}, should fail due to margin not sufficient");
|
||||
}
|
||||
|
||||
Buy(_btcUsd.Symbol, 100);
|
||||
|
||||
var marginUsed = Portfolio.TotalMarginUsed;
|
||||
var btcUsdHoldings = _btcUsd.Holdings;
|
||||
|
||||
// Coin futures value is 100 USD
|
||||
var holdingsValueBtcUsd = 100;
|
||||
if (Math.Abs(btcUsdHoldings.TotalSaleVolume - holdingsValueBtcUsd) > 1)
|
||||
{
|
||||
throw new Exception($"Unexpected TotalSaleVolume {btcUsdHoldings.TotalSaleVolume}");
|
||||
}
|
||||
if (Math.Abs(btcUsdHoldings.AbsoluteHoldingsCost - holdingsValueBtcUsd) > 1)
|
||||
{
|
||||
throw new Exception($"Unexpected holdings cost {btcUsdHoldings.HoldingsCost}");
|
||||
}
|
||||
// margin used is based on the maintenance rate
|
||||
if (Math.Abs(btcUsdHoldings.AbsoluteHoldingsCost * 0.05m - marginUsed) > 1
|
||||
|| _btcUsd.BuyingPowerModel.GetMaintenanceMargin(_btcUsd) != marginUsed)
|
||||
{
|
||||
throw new Exception($"Unexpected margin used {marginUsed}");
|
||||
}
|
||||
|
||||
Buy(_btcUsdt.Symbol, 0.01);
|
||||
|
||||
marginUsed = Portfolio.TotalMarginUsed - marginUsed;
|
||||
var btcUsdtHoldings = _btcUsdt.Holdings;
|
||||
|
||||
// USDT futures value is based on it's price
|
||||
var holdingsValueUsdt = _btcUsdt.Price * _btcUsdt.SymbolProperties.ContractMultiplier * 0.01m;
|
||||
|
||||
if (Math.Abs(btcUsdtHoldings.TotalSaleVolume - holdingsValueUsdt) > 1)
|
||||
{
|
||||
throw new Exception($"Unexpected TotalSaleVolume {btcUsdtHoldings.TotalSaleVolume}");
|
||||
}
|
||||
if (Math.Abs(btcUsdtHoldings.AbsoluteHoldingsCost - holdingsValueUsdt) > 1)
|
||||
{
|
||||
throw new Exception($"Unexpected holdings cost {btcUsdtHoldings.HoldingsCost}");
|
||||
}
|
||||
if (Math.Abs(btcUsdtHoldings.AbsoluteHoldingsCost * 0.05m - marginUsed) > 1
|
||||
|| _btcUsdt.BuyingPowerModel.GetMaintenanceMargin(_btcUsdt) != marginUsed)
|
||||
{
|
||||
throw new Exception($"Unexpected margin used {marginUsed}");
|
||||
}
|
||||
|
||||
// position just opened should be just spread here
|
||||
var unrealizedProfit = Portfolio.TotalUnrealizedProfit;
|
||||
if ((5 - Math.Abs(unrealizedProfit)) < 0)
|
||||
{
|
||||
throw new Exception($"Unexpected TotalUnrealizedProfit {Portfolio.TotalUnrealizedProfit}");
|
||||
}
|
||||
|
||||
if (Portfolio.TotalProfit != 0)
|
||||
{
|
||||
throw new Exception($"Unexpected TotalProfit {Portfolio.TotalProfit}");
|
||||
}
|
||||
}
|
||||
}
|
||||
// let's revert our position
|
||||
else if (Transactions.OrdersCount == 3)
|
||||
{
|
||||
Sell(_btcUsd.Symbol, 300);
|
||||
|
||||
var btcUsdHoldings = _btcUsd.Holdings;
|
||||
|
||||
if (Math.Abs(btcUsdHoldings.AbsoluteHoldingsCost - 100 * 2) > 1)
|
||||
{
|
||||
throw new Exception($"Unexpected holdings cost {btcUsdHoldings.HoldingsCost}");
|
||||
}
|
||||
|
||||
Sell(_btcUsdt.Symbol, 0.03);
|
||||
|
||||
var btcUsdtHoldings = _btcUsdt.Holdings;
|
||||
|
||||
// USDT futures value is based on it's price
|
||||
var holdingsValueUsdt = _btcUsdt.Price * _btcUsdt.SymbolProperties.ContractMultiplier * 0.02m;
|
||||
|
||||
if (Math.Abs(btcUsdtHoldings.AbsoluteHoldingsCost - holdingsValueUsdt) > 1)
|
||||
{
|
||||
throw new Exception($"Unexpected holdings cost {btcUsdtHoldings.HoldingsCost}");
|
||||
}
|
||||
|
||||
// position just opened should be just spread here
|
||||
var profit = Portfolio.TotalUnrealizedProfit;
|
||||
if ((5 - Math.Abs(profit)) < 0)
|
||||
{
|
||||
throw new Exception($"Unexpected TotalUnrealizedProfit {Portfolio.TotalUnrealizedProfit}");
|
||||
}
|
||||
// we barely did any difference on the previous trade
|
||||
if ((5 - Math.Abs(Portfolio.TotalProfit)) < 0)
|
||||
{
|
||||
throw new Exception($"Unexpected TotalProfit {Portfolio.TotalProfit}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnOrderEvent(OrderEvent orderEvent)
|
||||
{
|
||||
Debug(Time + " " + orderEvent);
|
||||
}
|
||||
|
||||
public override void OnEndOfAlgorithm()
|
||||
{
|
||||
Log($"{Time} - TotalPortfolioValue: {Portfolio.TotalPortfolioValue}");
|
||||
Log($"{Time} - CashBook: {Portfolio.CashBook}");
|
||||
|
||||
if (_interestPerSymbol.Any(kvp => kvp.Value == 0))
|
||||
{
|
||||
throw new Exception("Expected interest rate data for all symbols");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.
|
||||
/// </summary>
|
||||
public bool CanRunLocally { get; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// This is used by the regression test system to indicate which languages this algorithm is written in.
|
||||
/// </summary>
|
||||
public Language[] Languages { get; } = { Language.CSharp, Language.Python };
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 8625;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
/// </summary>
|
||||
public int AlgorithmHistoryDataPoints => 60;
|
||||
|
||||
/// <summary>
|
||||
/// This is used by the regression test system to indicate what the expected statistics are from running the algorithm
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "4"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
{"Drawdown", "0%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "0"},
|
||||
{"Beta", "0"},
|
||||
{"Annual Standard Deviation", "0"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "0"},
|
||||
{"Tracking Error", "0"},
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$0.60"},
|
||||
{"Estimated Strategy Capacity", "$200000000.00"},
|
||||
{"Lowest Capacity Asset", "BTCUSDT 2V3"},
|
||||
{"Portfolio Turnover", "1.08%"},
|
||||
{"OrderListHash", "7aad0274476dca1c5f866f28afc68662"}
|
||||
};
|
||||
}
|
||||
}
|
||||
171
Algorithm.CSharp/BybitCryptoRegressionAlgorithm.cs
Normal file
171
Algorithm.CSharp/BybitCryptoRegressionAlgorithm.cs
Normal file
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
|
||||
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using QuantConnect.Data;
|
||||
using QuantConnect.Brokerages;
|
||||
using QuantConnect.Indicators;
|
||||
using QuantConnect.Orders;
|
||||
using QuantConnect.Interfaces;
|
||||
|
||||
namespace QuantConnect.Algorithm.CSharp
|
||||
{
|
||||
/// <summary>
|
||||
/// Algorithm demonstrating and ensuring that Bybit crypto brokerage model works as expected
|
||||
/// </summary>
|
||||
public class BybitCryptoRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition
|
||||
{
|
||||
private Symbol _btcUsdt;
|
||||
|
||||
private ExponentialMovingAverage _fast;
|
||||
private ExponentialMovingAverage _slow;
|
||||
|
||||
private bool _liquidated;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
SetStartDate(2022, 12, 13);
|
||||
SetEndDate(2022, 12, 13);
|
||||
|
||||
// Set account currency (USDT)
|
||||
SetAccountCurrency("USDT");
|
||||
|
||||
// Set strategy cash (USD)
|
||||
SetCash(100000);
|
||||
|
||||
// Add some coin as initial holdings
|
||||
// When connected to a real brokerage, the amount specified in SetCash
|
||||
// will be replaced with the amount in your actual account.
|
||||
SetCash("BTC", 1m);
|
||||
|
||||
SetBrokerageModel(BrokerageName.Bybit, AccountType.Cash);
|
||||
|
||||
_btcUsdt = AddCrypto("BTCUSDT").Symbol;
|
||||
|
||||
// create two moving averages
|
||||
_fast = EMA(_btcUsdt, 30, Resolution.Minute);
|
||||
_slow = EMA(_btcUsdt, 60, Resolution.Minute);
|
||||
}
|
||||
|
||||
public override void OnData(Slice data)
|
||||
{
|
||||
if (Portfolio.CashBook["USDT"].ConversionRate == 0 || Portfolio.CashBook["BTC"].ConversionRate == 0)
|
||||
{
|
||||
Log($"USDT conversion rate: {Portfolio.CashBook["USDT"].ConversionRate}");
|
||||
Log($"BTC conversion rate: {Portfolio.CashBook["BTC"].ConversionRate}");
|
||||
|
||||
throw new Exception("Conversion rate is 0");
|
||||
}
|
||||
|
||||
if (!_slow.IsReady)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var btcAmount = Portfolio.CashBook["BTC"].Amount;
|
||||
if (_fast > _slow)
|
||||
{
|
||||
if (btcAmount == 1m && !_liquidated)
|
||||
{
|
||||
Buy(_btcUsdt, 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (btcAmount > 1m)
|
||||
{
|
||||
Liquidate(_btcUsdt);
|
||||
_liquidated = true;
|
||||
}
|
||||
else if (btcAmount > 0 && _liquidated && Transactions.GetOpenOrders().Count == 0)
|
||||
{
|
||||
// Place a limit order to sell our initial BTC holdings at 1% above the current price
|
||||
var limitPrice = Math.Round(Securities[_btcUsdt].Price * 1.01m, 2);
|
||||
LimitOrder(_btcUsdt, -btcAmount, limitPrice);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnOrderEvent(OrderEvent orderEvent)
|
||||
{
|
||||
Debug(Time + " " + orderEvent);
|
||||
}
|
||||
|
||||
public override void OnEndOfAlgorithm()
|
||||
{
|
||||
Log($"{Time} - TotalPortfolioValue: {Portfolio.TotalPortfolioValue}");
|
||||
Log($"{Time} - CashBook: {Portfolio.CashBook}");
|
||||
|
||||
var btcAmount = Portfolio.CashBook["BTC"].Amount;
|
||||
if (btcAmount > 0)
|
||||
{
|
||||
throw new Exception($"BTC holdings should be zero at the end of the algorithm, but was {btcAmount}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.
|
||||
/// </summary>
|
||||
public bool CanRunLocally { get; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// This is used by the regression test system to indicate which languages this algorithm is written in.
|
||||
/// </summary>
|
||||
public Language[] Languages { get; } = { Language.CSharp, Language.Python };
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 2883;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
/// </summary>
|
||||
public int AlgorithmHistoryDataPoints => 60;
|
||||
|
||||
/// <summary>
|
||||
/// This is used by the regression test system to indicate what the expected statistics are from running the algorithm
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "3"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
{"Drawdown", "0%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "0"},
|
||||
{"Beta", "0"},
|
||||
{"Annual Standard Deviation", "0"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "0"},
|
||||
{"Tracking Error", "0"},
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "₮51.65"},
|
||||
{"Estimated Strategy Capacity", "₮560000.00"},
|
||||
{"Lowest Capacity Asset", "BTCUSDT 2UZ"},
|
||||
{"Portfolio Turnover", "44.04%"},
|
||||
{"OrderListHash", "fc9f71eab08b21ebae023529fb6f6c10"}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -159,25 +159,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$370000.00"},
|
||||
{"Lowest Capacity Asset", "ETHUSD XJ"},
|
||||
{"Fitness Score", "0.501"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "-30.158"},
|
||||
{"Portfolio Turnover", "1.033"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "104.59%"},
|
||||
{"OrderListHash", "aea2e321d17414c1f3c6fa2491f10c88"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "0.300%"},
|
||||
{"Expectancy", "-0.345"},
|
||||
{"Net Profit", "-0.337%"},
|
||||
{"Sharpe Ratio", "-19.772"},
|
||||
{"Sharpe Ratio", "-21.957"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "68%"},
|
||||
{"Win Rate", "32%"},
|
||||
@@ -107,25 +107,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Fees", "€0.00"},
|
||||
{"Estimated Strategy Capacity", "€670000.00"},
|
||||
{"Lowest Capacity Asset", "DE30EUR 8I"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "-101.587"},
|
||||
{"Return Over Maximum Drawdown", "-110.633"},
|
||||
{"Portfolio Turnover", "9.513"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "€0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "€0"},
|
||||
{"Mean Population Estimated Insight Value", "€0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "1062.25%"},
|
||||
{"OrderListHash", "64c098abe3c1e7206424b0c3825b0069"}
|
||||
};
|
||||
}
|
||||
|
||||
42
Algorithm.CSharp/ClassicRangeConsolidatorAlgorithm.cs
Normal file
42
Algorithm.CSharp/ClassicRangeConsolidatorAlgorithm.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
|
||||
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using QuantConnect.Data.Consolidators;
|
||||
using QuantConnect.Data.Market;
|
||||
|
||||
namespace QuantConnect.Algorithm.CSharp
|
||||
{
|
||||
/// <summary>
|
||||
/// Example algorithm of how to use the ClassicRangeConsolidator
|
||||
/// </summary>
|
||||
public class ClassicRangeConsolidatorAlgorithm : RangeConsolidatorAlgorithm
|
||||
{
|
||||
protected override RangeConsolidator CreateRangeConsolidator()
|
||||
{
|
||||
return new ClassicRangeConsolidator(Range);
|
||||
}
|
||||
|
||||
protected override void OnDataConsolidated(Object sender, RangeBar rangeBar)
|
||||
{
|
||||
base.OnDataConsolidated(sender, rangeBar);
|
||||
|
||||
if (rangeBar.Volume == 0)
|
||||
{
|
||||
throw new Exception($"All RangeBar's should have non-zero volume, but this doesn't");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
|
||||
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
using QuantConnect.Data.Consolidators;
|
||||
using QuantConnect.Data.Market;
|
||||
using System;
|
||||
|
||||
namespace QuantConnect.Algorithm.CSharp
|
||||
{
|
||||
/// <summary>
|
||||
/// Example algorithm of how to use ClassicRangeConsolidator with Tick resolution
|
||||
/// </summary>
|
||||
public class ClassicRangeConsolidatorWithTickAlgorithm : RangeConsolidatorWithTickAlgorithm
|
||||
{
|
||||
protected override RangeConsolidator CreateRangeConsolidator()
|
||||
{
|
||||
return new ClassicRangeConsolidator(Range);
|
||||
}
|
||||
|
||||
protected override void OnDataConsolidated(Object sender, RangeBar rangeBar)
|
||||
{
|
||||
base.OnDataConsolidated(sender, rangeBar);
|
||||
|
||||
if (rangeBar.Volume == 0)
|
||||
{
|
||||
throw new Exception($"All RangeBar's should have non-zero volume, but this doesn't");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -129,45 +129,27 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Trades", "29"},
|
||||
{"Average Win", "1.85%"},
|
||||
{"Average Loss", "-1.49%"},
|
||||
{"Compounding Annual Return", "7.819%"},
|
||||
{"Compounding Annual Return", "7.817%"},
|
||||
{"Drawdown", "6.800%"},
|
||||
{"Expectancy", "0.281"},
|
||||
{"Net Profit", "7.841%"},
|
||||
{"Sharpe Ratio", "0.799"},
|
||||
{"Probabilistic Sharpe Ratio", "39.344%"},
|
||||
{"Net Profit", "7.839%"},
|
||||
{"Sharpe Ratio", "0.692"},
|
||||
{"Probabilistic Sharpe Ratio", "39.336%"},
|
||||
{"Loss Rate", "43%"},
|
||||
{"Win Rate", "57%"},
|
||||
{"Profit-Loss Ratio", "1.24"},
|
||||
{"Alpha", "0.009"},
|
||||
{"Alpha", "0.004"},
|
||||
{"Beta", "0.411"},
|
||||
{"Annual Standard Deviation", "0.07"},
|
||||
{"Annual Variance", "0.005"},
|
||||
{"Information Ratio", "-0.703"},
|
||||
{"Information Ratio", "-0.704"},
|
||||
{"Tracking Error", "0.083"},
|
||||
{"Treynor Ratio", "0.136"},
|
||||
{"Total Fees", "$129.35"},
|
||||
{"Treynor Ratio", "0.118"},
|
||||
{"Total Fees", "$129.34"},
|
||||
{"Estimated Strategy Capacity", "$1000000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.062"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "1.023"},
|
||||
{"Return Over Maximum Drawdown", "1.142"},
|
||||
{"Portfolio Turnover", "0.094"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "b2286d2421294408c3a390e614f40ef9"}
|
||||
{"Portfolio Turnover", "7.91%"},
|
||||
{"OrderListHash", "cabe86df8bdef1204139d41baff20050"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
// we want 50% allocation in each security in our universe
|
||||
foreach (var security in _changes.AddedSecurities)
|
||||
{
|
||||
if (security.Fundamentals.EarningRatios.EquityPerShareGrowth.OneYear > 0.25m)
|
||||
if (security.Fundamentals.EarningRatios.EquityPerShareGrowth.OneYear > 0.25)
|
||||
{
|
||||
SetHoldings(security.Symbol, 0.5m);
|
||||
Debug("Purchased Stock: " + security.Symbol.Value);
|
||||
@@ -159,7 +159,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 7239;
|
||||
public long DataPoints => 7244;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -178,40 +178,22 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "1.400%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "1.163%"},
|
||||
{"Sharpe Ratio", "2.754"},
|
||||
{"Sharpe Ratio", "2.666"},
|
||||
{"Probabilistic Sharpe Ratio", "64.748%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "100%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "0.277"},
|
||||
{"Alpha", "0.272"},
|
||||
{"Beta", "0.436"},
|
||||
{"Annual Standard Deviation", "0.086"},
|
||||
{"Annual Variance", "0.007"},
|
||||
{"Information Ratio", "3.572"},
|
||||
{"Tracking Error", "0.092"},
|
||||
{"Treynor Ratio", "0.54"},
|
||||
{"Treynor Ratio", "0.523"},
|
||||
{"Total Fees", "$2.00"},
|
||||
{"Estimated Strategy Capacity", "$49000000.00"},
|
||||
{"Lowest Capacity Asset", "IBM R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.076"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "27.328"},
|
||||
{"Return Over Maximum Drawdown", "24.002"},
|
||||
{"Portfolio Turnover", "0.076"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "6.64%"},
|
||||
{"OrderListHash", "159887a90516df8ba8e8d35b9c30b227"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -35,6 +35,12 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
private Symbol _aapl;
|
||||
private Symbol _twx;
|
||||
|
||||
private Dictionary<string, decimal> _rawPrices = new()
|
||||
{
|
||||
{ "AOL", 70 },
|
||||
{ "AAPL", 650 }
|
||||
};
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
_twx = QuantConnect.Symbol.Create("TWX", SecurityType.Equity, Market.USA);
|
||||
@@ -106,6 +112,15 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{
|
||||
throw new Exception($"Was expecting DataNormalizationMode.Raw configurations for {security.Symbol}");
|
||||
}
|
||||
|
||||
if (security.Symbol.SecurityType == SecurityType.Equity)
|
||||
{
|
||||
var expectedPrice = _rawPrices[security.Symbol.ID.Symbol];
|
||||
if (Math.Abs(security.Price - expectedPrice) > expectedPrice * 0.1m)
|
||||
{
|
||||
throw new Exception($"Unexpected raw prices for symbol {security.Symbol}");
|
||||
}
|
||||
}
|
||||
}
|
||||
_changes = SecurityChanges.None;
|
||||
}
|
||||
@@ -142,7 +157,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 998462;
|
||||
public long DataPoints => 998464;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -154,26 +169,30 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Fitness Score", "0.12"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "79228162514264337593543950335"},
|
||||
{"Portfolio Turnover", "0.12"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "2a6319d0d474f976e653dd1ebc42caac"}
|
||||
{"Total Trades", "13"},
|
||||
{"Average Win", "0.04%"},
|
||||
{"Average Loss", "-0.05%"},
|
||||
{"Compounding Annual Return", "-24.719%"},
|
||||
{"Drawdown", "0.500%"},
|
||||
{"Expectancy", "-0.685"},
|
||||
{"Net Profit", "-0.233%"},
|
||||
{"Sharpe Ratio", "-9.078"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "83%"},
|
||||
{"Win Rate", "17%"},
|
||||
{"Profit-Loss Ratio", "0.89"},
|
||||
{"Alpha", "4.632"},
|
||||
{"Beta", "-1.524"},
|
||||
{"Annual Standard Deviation", "0.029"},
|
||||
{"Annual Variance", "0.001"},
|
||||
{"Information Ratio", "-72.647"},
|
||||
{"Tracking Error", "0.048"},
|
||||
{"Treynor Ratio", "0.172"},
|
||||
{"Total Fees", "$16.10"},
|
||||
{"Estimated Strategy Capacity", "$3100000.00"},
|
||||
{"Lowest Capacity Asset", "AOL VRKS95ENLBYE|AOL R735QTJ8XC9X"},
|
||||
{"Portfolio Turnover", "17.64%"},
|
||||
{"OrderListHash", "ad0539728c979e78a32749dda2e544ca"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,40 +133,22 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "1.700%"},
|
||||
{"Expectancy", "0.850"},
|
||||
{"Net Profit", "0.637%"},
|
||||
{"Sharpe Ratio", "1.088"},
|
||||
{"Sharpe Ratio", "1.024"},
|
||||
{"Probabilistic Sharpe Ratio", "50.223%"},
|
||||
{"Loss Rate", "40%"},
|
||||
{"Win Rate", "60%"},
|
||||
{"Profit-Loss Ratio", "2.08"},
|
||||
{"Alpha", "0.198"},
|
||||
{"Alpha", "0.196"},
|
||||
{"Beta", "0.741"},
|
||||
{"Annual Standard Deviation", "0.118"},
|
||||
{"Annual Variance", "0.014"},
|
||||
{"Information Ratio", "2.294"},
|
||||
{"Tracking Error", "0.097"},
|
||||
{"Treynor Ratio", "0.173"},
|
||||
{"Treynor Ratio", "0.163"},
|
||||
{"Total Fees", "$27.94"},
|
||||
{"Estimated Strategy Capacity", "$200000000.00"},
|
||||
{"Lowest Capacity Asset", "AAPL R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.28"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "3"},
|
||||
{"Return Over Maximum Drawdown", "9.559"},
|
||||
{"Portfolio Turnover", "0.308"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "26.69%"},
|
||||
{"OrderListHash", "de456413f89396bd6f920686219ed0a5"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -126,25 +126,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", ""},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "79228162514264337593543950335"},
|
||||
{"Portfolio Turnover", "0"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "0%"},
|
||||
{"OrderListHash", "d41d8cd98f00b204e9800998ecf8427e"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Drawdown", "1.000%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "1.003%"},
|
||||
{"Sharpe Ratio", "5.36"},
|
||||
{"Sharpe Ratio", "5.273"},
|
||||
{"Probabilistic Sharpe Ratio", "69.521%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -128,29 +128,11 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Annual Variance", "0.007"},
|
||||
{"Information Ratio", "6.477"},
|
||||
{"Tracking Error", "0"},
|
||||
{"Treynor Ratio", "0.462"},
|
||||
{"Treynor Ratio", "0.455"},
|
||||
{"Total Fees", "$3.08"},
|
||||
{"Estimated Strategy Capacity", "$720000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.141"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "10.385"},
|
||||
{"Return Over Maximum Drawdown", "58.709"},
|
||||
{"Portfolio Turnover", "0.143"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"Portfolio Turnover", "12.54%"},
|
||||
{"OrderListHash", "50145c3c1d58b09f38ec1b77cfe69eae"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,187 @@
|
||||
/*
|
||||
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
|
||||
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using QuantConnect.Algorithm.Framework.Portfolio.SignalExports;
|
||||
using QuantConnect.Data;
|
||||
using QuantConnect.Indicators;
|
||||
using QuantConnect.Interfaces;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace QuantConnect.Algorithm.CSharp
|
||||
{
|
||||
/// <summary>
|
||||
/// This algorithm sends a list of portfolio targets from algorithm's Portfolio
|
||||
/// to Collective2 API every time the ema indicators crosses between themselves
|
||||
/// </summary>
|
||||
/// <meta name="tag" content="using data" />
|
||||
/// <meta name="tag" content="using quantconnect" />
|
||||
/// <meta name="tag" content="securities and portfolio" />
|
||||
public class Collective2PortfolioSignalExportDemonstrationAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition
|
||||
{
|
||||
/// <summary>
|
||||
/// Collective2 APIv4 KEY: This value is provided by Collective2 in their webpage in your account section (See https://collective2.com/account-info)
|
||||
/// See API documentation at https://trade.collective2.com/c2-api
|
||||
/// </summary>
|
||||
private const string _collective2ApiKey = "YOUR APIV4 KEY";
|
||||
|
||||
/// <summary>
|
||||
/// Collective2 System ID: This value is found beside the system's name (strategy's name) on the main system page
|
||||
/// </summary>
|
||||
private const int _collective2SystemId = 0;
|
||||
|
||||
private ExponentialMovingAverage _fast;
|
||||
private ExponentialMovingAverage _slow;
|
||||
private bool _emaFastWasAbove;
|
||||
private bool _emaFastIsNotSet;
|
||||
private bool _firstCall = true;
|
||||
|
||||
/// <summary>
|
||||
/// Symbols accepted by Collective2. Collective2 accepts stock,
|
||||
/// future, forex and US stock option symbols
|
||||
/// </summary>
|
||||
private List<Symbol> _symbols = new()
|
||||
{
|
||||
QuantConnect.Symbol.Create("SPY", SecurityType.Equity, Market.USA, null, null),
|
||||
QuantConnect.Symbol.Create("EURUSD", SecurityType.Forex, Market.Oanda, null, null),
|
||||
QuantConnect.Symbol.CreateFuture("ES", Market.CME, new DateTime(2023, 12, 15), null),
|
||||
QuantConnect.Symbol.CreateOption("GOOG", Market.USA, OptionStyle.American, OptionRight.Call, 130, new DateTime(2023, 9, 1)),
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the date and add all equity symbols present in _symbols list
|
||||
/// </summary>
|
||||
public override void Initialize()
|
||||
{
|
||||
SetStartDate(2013, 10, 07);
|
||||
SetEndDate(2013, 10, 11);
|
||||
SetCash(100 * 1000);
|
||||
|
||||
foreach (var item in _symbols)
|
||||
{
|
||||
AddSecurity(item);
|
||||
}
|
||||
|
||||
_fast = EMA("SPY", 10);
|
||||
_slow = EMA("SPY", 100);
|
||||
|
||||
// Initialize this flag, to check when the ema indicators crosses between themselves
|
||||
_emaFastIsNotSet = true;
|
||||
|
||||
// Set Collective2 signal export provider
|
||||
SignalExport.AddSignalExportProviders(new Collective2SignalExport(_collective2ApiKey, _collective2SystemId));
|
||||
|
||||
SetWarmUp(100);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reduce the quantity of holdings for SPY or increase it, depending the case,
|
||||
/// when the EMA's indicators crosses between themselves, then send a signal to
|
||||
/// Collective2 API
|
||||
/// </summary>
|
||||
/// <param name="slice"></param>
|
||||
public override void OnData(Slice slice)
|
||||
{
|
||||
if (IsWarmingUp) return;
|
||||
|
||||
// Place an order as soon as possible to send a signal.
|
||||
if (_firstCall)
|
||||
{
|
||||
SetHoldings("SPY", 0.1);
|
||||
SignalExport.SetTargetPortfolioFromPortfolio();
|
||||
_firstCall = false;
|
||||
}
|
||||
|
||||
// Set the value of flag _emaFastWasAbove, to know when the ema indicators crosses between themselves
|
||||
if (_emaFastIsNotSet)
|
||||
{
|
||||
if (_fast > _slow * 1.001m)
|
||||
{
|
||||
_emaFastWasAbove = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
_emaFastWasAbove = false;
|
||||
}
|
||||
_emaFastIsNotSet = false;
|
||||
}
|
||||
|
||||
// Check whether ema fast and ema slow crosses. If they do, set holdings to SPY
|
||||
// or reduce its holdings, and send signals to the Collective2 API from your
|
||||
// Portfolio
|
||||
if ((_fast > _slow * 1.001m) && (!_emaFastWasAbove))
|
||||
{
|
||||
SetHoldings("SPY", 0.1);
|
||||
SignalExport.SetTargetPortfolioFromPortfolio();
|
||||
}
|
||||
else if ((_fast < _slow * 0.999m) && (_emaFastWasAbove))
|
||||
{
|
||||
SetHoldings("SPY", 0.01);
|
||||
SignalExport.SetTargetPortfolioFromPortfolio();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.
|
||||
/// </summary>
|
||||
public bool CanRunLocally { get; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// This is used by the regression test system to indicate which languages this algorithm is written in.
|
||||
/// </summary>
|
||||
public virtual Language[] Languages { get; } = { Language.CSharp, Language.Python };
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 4155;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
/// </summary>
|
||||
public int AlgorithmHistoryDataPoints => 11147;
|
||||
|
||||
/// <summary>
|
||||
/// This is used by the regression test system to indicate what the expected statistics are from running the algorithm
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "2"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "14.180%"},
|
||||
{"Drawdown", "0.200%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0.170%"},
|
||||
{"Sharpe Ratio", "4.88"},
|
||||
{"Probabilistic Sharpe Ratio", "67.725%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "-0.088"},
|
||||
{"Beta", "0.099"},
|
||||
{"Annual Standard Deviation", "0.022"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-9.315"},
|
||||
{"Tracking Error", "0.201"},
|
||||
{"Treynor Ratio", "1.086"},
|
||||
{"Total Fees", "$2.00"},
|
||||
{"Estimated Strategy Capacity", "$260000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Portfolio Turnover", "2.00%"},
|
||||
{"OrderListHash", "4d030e24bdb0fdbf6dc2c2b22c763688"}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,205 @@
|
||||
/*
|
||||
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
|
||||
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using QuantConnect.Algorithm.Framework.Portfolio;
|
||||
using QuantConnect.Algorithm.Framework.Portfolio.SignalExports;
|
||||
using QuantConnect.Data;
|
||||
using QuantConnect.Indicators;
|
||||
using QuantConnect.Interfaces;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace QuantConnect.Algorithm.CSharp
|
||||
{
|
||||
/// <summary>
|
||||
/// This algorithm sends a list of portfolio targets to Collective2 API every time the ema indicators crosses between themselves
|
||||
/// </summary>
|
||||
/// <meta name="tag" content="using data" />
|
||||
/// <meta name="tag" content="using quantconnect" />
|
||||
/// <meta name="tag" content="securities and portfolio" />
|
||||
public class Collective2SignalExportDemonstrationAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition
|
||||
{
|
||||
/// <summary>
|
||||
/// Collective2 APIv4 KEY: This value is provided by Collective2 in your account section (See https://collective2.com/account-info)
|
||||
/// See API documentation at https://trade.collective2.com/c2-api
|
||||
/// </summary>
|
||||
private const string _collective2ApiKey = "YOUR APIV4 KEY";
|
||||
|
||||
/// <summary>
|
||||
/// Collective2 System ID: This value is found beside the system's name (strategy's name) on the main system page
|
||||
/// </summary>
|
||||
private const int _collective2SystemId = 0;
|
||||
|
||||
private ExponentialMovingAverage _fast;
|
||||
private ExponentialMovingAverage _slow;
|
||||
private bool _emaFastWasAbove;
|
||||
private bool _emaFastIsNotSet;
|
||||
private bool _firstCall = true;
|
||||
|
||||
private PortfolioTarget[] _targets = new PortfolioTarget[4];
|
||||
|
||||
/// <summary>
|
||||
/// Symbols accepted by Collective2. Collective2 accepts stock,
|
||||
/// future, forex and US stock option symbols
|
||||
/// </summary>
|
||||
private List<Symbol> _symbols = new()
|
||||
{
|
||||
QuantConnect.Symbol.Create("SPY", SecurityType.Equity, Market.USA, null, null),
|
||||
QuantConnect.Symbol.Create("EURUSD", SecurityType.Forex, Market.Oanda, null, null),
|
||||
QuantConnect.Symbol.CreateFuture("ES", Market.CME, new DateTime(2023, 12, 15), null),
|
||||
QuantConnect.Symbol.CreateOption("GOOG", Market.USA, OptionStyle.American, OptionRight.Call, 130, new DateTime(2023, 9, 1)),
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the date and add all equity symbols present in _symbols list.
|
||||
/// Besides, make a new PortfolioTarget for each symbol in _symbols, assign it
|
||||
/// an initial quantity and save it in _targets array
|
||||
/// </summary>
|
||||
public override void Initialize()
|
||||
{
|
||||
SetStartDate(2013, 10, 07);
|
||||
SetEndDate(2013, 10, 11);
|
||||
SetCash(100 * 1000);
|
||||
|
||||
var index = 0;
|
||||
foreach (var item in _symbols)
|
||||
{
|
||||
var symbol = AddSecurity(item).Symbol;
|
||||
if (symbol.SecurityType == SecurityType.Equity
|
||||
|| symbol.SecurityType == SecurityType.Forex)
|
||||
{
|
||||
_targets[index] = new PortfolioTarget(symbol, (decimal)0.05);
|
||||
}
|
||||
else
|
||||
{
|
||||
_targets[index] = new PortfolioTarget(symbol, 1);
|
||||
}
|
||||
index++;
|
||||
}
|
||||
|
||||
_fast = EMA("SPY", 10);
|
||||
_slow = EMA("SPY", 100);
|
||||
|
||||
// Initialize this flag, to check when the ema indicators crosses between themselves
|
||||
_emaFastIsNotSet = true;
|
||||
|
||||
// Set Collective2 signal export provider
|
||||
SignalExport.AddSignalExportProviders(new Collective2SignalExport(_collective2ApiKey, _collective2SystemId));
|
||||
|
||||
SetWarmUp(100);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reduce the quantity of holdings for SPY or increase it, depending the case,
|
||||
/// when the EMA's indicators crosses between themselves, then send a signal to
|
||||
/// Collective2 API
|
||||
/// </summary>
|
||||
/// <param name="slice"></param>
|
||||
public override void OnData(Slice slice)
|
||||
{
|
||||
if (IsWarmingUp) return;
|
||||
|
||||
// Place an order as soon as possible to send a signal.
|
||||
if (_firstCall)
|
||||
{
|
||||
SetHoldings("SPY", 0.1);
|
||||
_targets[0] = new PortfolioTarget(Portfolio["SPY"].Symbol, (decimal)0.1);
|
||||
SignalExport.SetTargetPortfolio(_targets);
|
||||
_firstCall = false;
|
||||
}
|
||||
|
||||
// Set the value of flag _emaFastWasAbove, to know when the ema indicators crosses between themselves
|
||||
if (_emaFastIsNotSet)
|
||||
{
|
||||
if (_fast > _slow * 1.001m)
|
||||
{
|
||||
_emaFastWasAbove = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
_emaFastWasAbove = false;
|
||||
}
|
||||
_emaFastIsNotSet = false;
|
||||
}
|
||||
|
||||
// Check whether ema fast and ema slow crosses. If they do, set holdings to SPY
|
||||
// or reduce its holdings, change its value in _targets array and send signals
|
||||
// to the Collective2 API from _targets array
|
||||
if ((_fast > _slow * 1.001m) && (!_emaFastWasAbove))
|
||||
{
|
||||
SetHoldings("SPY", 0.1);
|
||||
_targets[0] = new PortfolioTarget(Portfolio["SPY"].Symbol, (decimal)0.1);
|
||||
SignalExport.SetTargetPortfolio(_targets);
|
||||
}
|
||||
else if ((_fast < _slow * 0.999m) && (_emaFastWasAbove))
|
||||
{
|
||||
SetHoldings("SPY", 0.01);
|
||||
_targets[0] = new PortfolioTarget(Portfolio["SPY"].Symbol, (decimal)0.01);
|
||||
SignalExport.SetTargetPortfolio(_targets);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.
|
||||
/// </summary>
|
||||
public bool CanRunLocally { get; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// This is used by the regression test system to indicate which languages this algorithm is written in.
|
||||
/// </summary>
|
||||
public virtual Language[] Languages { get; } = { Language.CSharp, Language.Python };
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 4155;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
/// </summary>
|
||||
public int AlgorithmHistoryDataPoints => 11147;
|
||||
|
||||
/// <summary>
|
||||
/// This is used by the regression test system to indicate what the expected statistics are from running the algorithm
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "2"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "14.180%"},
|
||||
{"Drawdown", "0.200%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0.170%"},
|
||||
{"Sharpe Ratio", "4.88"},
|
||||
{"Probabilistic Sharpe Ratio", "67.725%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "-0.088"},
|
||||
{"Beta", "0.099"},
|
||||
{"Annual Standard Deviation", "0.022"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-9.315"},
|
||||
{"Tracking Error", "0.201"},
|
||||
{"Treynor Ratio", "1.086"},
|
||||
{"Total Fees", "$2.00"},
|
||||
{"Estimated Strategy Capacity", "$260000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Portfolio Turnover", "2.00%"},
|
||||
{"OrderListHash", "4d030e24bdb0fdbf6dc2c2b22c763688"}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -84,29 +84,11 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Information Ratio", "0"},
|
||||
{"Tracking Error", "0"},
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$7.50"},
|
||||
{"Estimated Strategy Capacity", "$8000.00"},
|
||||
{"Total Fees", "$26.00"},
|
||||
{"Estimated Strategy Capacity", "$58000.00"},
|
||||
{"Lowest Capacity Asset", "GOOCV W78ZERHAOVVQ|GOOCV VP83T1ZUHROL"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Return Over Maximum Drawdown", "0"},
|
||||
{"Portfolio Turnover", "0"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "c0f4b5d5c796e17949f7ec42c6569ce4"}
|
||||
{"Portfolio Turnover", "30.16%"},
|
||||
{"OrderListHash", "2b64aec759a089d23ccf9722d6b87ccd"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,29 +151,11 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Information Ratio", "0"},
|
||||
{"Tracking Error", "0"},
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$17.50"},
|
||||
{"Total Fees", "$52.00"},
|
||||
{"Estimated Strategy Capacity", "$5000.00"},
|
||||
{"Lowest Capacity Asset", "GOOCV W78ZERHAOVVQ|GOOCV VP83T1ZUHROL"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Return Over Maximum Drawdown", "0"},
|
||||
{"Portfolio Turnover", "0"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "17a5427a539f2b02a626fda15d6eb13f"}
|
||||
{"Portfolio Turnover", "60.91%"},
|
||||
{"OrderListHash", "186986b27fac082600a064a8a59df604"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
*/
|
||||
|
||||
using QuantConnect.Orders;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace QuantConnect.Algorithm.CSharp
|
||||
@@ -29,6 +30,15 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
return ComboMarketOrder(legs, quantity);
|
||||
}
|
||||
|
||||
public override void OnOrderEvent(OrderEvent orderEvent)
|
||||
{
|
||||
base.OnOrderEvent(orderEvent);
|
||||
if (orderEvent.Status == OrderStatus.Filled && orderEvent.OrderFee.Value.Amount != (orderEvent.AbsoluteFillQuantity * 0.65m))
|
||||
{
|
||||
throw new Exception($"The fee for each order should be {orderEvent.AbsoluteFillQuantity * 0.65m} USD, but for order {orderEvent.OrderId} was {orderEvent.OrderFee}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.
|
||||
/// </summary>
|
||||
@@ -73,29 +83,11 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Information Ratio", "0"},
|
||||
{"Tracking Error", "0"},
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$7.50"},
|
||||
{"Estimated Strategy Capacity", "$9000.00"},
|
||||
{"Total Fees", "$26.00"},
|
||||
{"Estimated Strategy Capacity", "$70000.00"},
|
||||
{"Lowest Capacity Asset", "GOOCV W78ZERHAOVVQ|GOOCV VP83T1ZUHROL"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Return Over Maximum Drawdown", "0"},
|
||||
{"Portfolio Turnover", "0"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "47f02f5139c4c4def9b26e8f5433fdcc"}
|
||||
{"Portfolio Turnover", "30.35%"},
|
||||
{"OrderListHash", "cf49ecb1e9787688df1d9920a75b83b7"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user