Compare commits
270 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
17ca8a743f | ||
|
|
a98a50237b | ||
|
|
51b018c616 | ||
|
|
c049a35121 | ||
|
|
8c66e2e715 | ||
|
|
bb3931d911 | ||
|
|
feff802479 | ||
|
|
dcbb2d3cf8 | ||
|
|
f298f6e21a | ||
|
|
ce197afe44 | ||
|
|
637fe75b25 | ||
|
|
6bf2acd0da | ||
|
|
5e2957cbf0 | ||
|
|
78c3f81b96 | ||
|
|
e500a6b466 | ||
|
|
b9ec218870 | ||
|
|
e39cec40f5 | ||
|
|
ea5e4ac8d0 | ||
|
|
1f975332c3 | ||
|
|
aa6b909a93 | ||
|
|
9cfd8b7403 | ||
|
|
fec27a56ce | ||
|
|
e96c08e208 | ||
|
|
d942d58717 | ||
|
|
387eae9e73 | ||
|
|
7e61483ad7 | ||
|
|
8595aff670 | ||
|
|
e375afbe20 | ||
|
|
1a1f64e7a6 | ||
|
|
2e9c7ade2c | ||
|
|
d3928fba6b | ||
|
|
09db45c91d | ||
|
|
64fe4ba13b | ||
|
|
2a82c6f9bb | ||
|
|
6f6fbee6ee | ||
|
|
67b9ecf391 | ||
|
|
0e81589efa | ||
|
|
07dbfc42a5 | ||
|
|
ea15e014e2 | ||
|
|
d602e260b4 | ||
|
|
e31a898269 | ||
|
|
1dd186acb4 | ||
|
|
330946785f | ||
|
|
48ce5ef88d | ||
|
|
76a0bdd769 | ||
|
|
b7740edd15 | ||
|
|
0264d346e6 | ||
|
|
f59a6be589 | ||
|
|
a5b309ae23 | ||
|
|
3d673d6de1 | ||
|
|
fdb8c20a1a | ||
|
|
6fe368106a | ||
|
|
379e2d3405 | ||
|
|
711a7b42d4 | ||
|
|
3fef33fbf4 | ||
|
|
32d39622c0 | ||
|
|
d3877c8ea9 | ||
|
|
2097a3f392 | ||
|
|
98a3fd4306 | ||
|
|
ef728bc91f | ||
|
|
1c973d12a5 | ||
|
|
8b804c4eca | ||
|
|
701a4672c5 | ||
|
|
63cff706e4 | ||
|
|
6828e164e0 | ||
|
|
7705895cc6 | ||
|
|
4262bb9152 | ||
|
|
645aa73e8e | ||
|
|
d4ba8ccead | ||
|
|
6f29130221 | ||
|
|
4c88e3184c | ||
|
|
3f6a907485 | ||
|
|
ec530d8e37 | ||
|
|
3a10afeac5 | ||
|
|
00e1cae16b | ||
|
|
07ded61fe9 | ||
|
|
0cd979f3bd | ||
|
|
3a9059ae4f | ||
|
|
518ab562ec | ||
|
|
20a5f690f8 | ||
|
|
17902e2f7d | ||
|
|
9df4a397d5 | ||
|
|
3a8a3dd27f | ||
|
|
3dab2e42eb | ||
|
|
1c93df8156 | ||
|
|
580a043baf | ||
|
|
6cb9164c7a | ||
|
|
ed9fb4a194 | ||
|
|
0b833b065e | ||
|
|
8ec2c4beeb | ||
|
|
fa329a9d51 | ||
|
|
adfb594d93 | ||
|
|
1eaf4d6ae0 | ||
|
|
bf2f310cae | ||
|
|
cc8caa9635 | ||
|
|
41a6fb721a | ||
|
|
27356512b8 | ||
|
|
abd092ac63 | ||
|
|
6a8edc1f34 | ||
|
|
4913a59f28 | ||
|
|
4c79d91635 | ||
|
|
0a1e481883 | ||
|
|
6879e93d79 | ||
|
|
1f4eee88dd | ||
|
|
c6ca0eeea5 | ||
|
|
3f3d13a1df | ||
|
|
f497a0206c | ||
|
|
0ba796c4cf | ||
|
|
50ccec9a01 | ||
|
|
1d52e5b14a | ||
|
|
50ab04e30d | ||
|
|
ff83d72487 | ||
|
|
3db813c9ae | ||
|
|
eeb44d841a | ||
|
|
e0fdbb2618 | ||
|
|
b75ed58411 | ||
|
|
aaab65fd7f | ||
|
|
65f8590d94 | ||
|
|
2525824390 | ||
|
|
1b8f396f1a | ||
|
|
2020f12825 | ||
|
|
3e00abb2e4 | ||
|
|
0f47ba657d | ||
|
|
8cdb2d4c10 | ||
|
|
d8a68afc3f | ||
|
|
a76fad952d | ||
|
|
939b14a6e8 | ||
|
|
9601155e28 | ||
|
|
51c70f6c46 | ||
|
|
dbad754a93 | ||
|
|
cd2e4edeb1 | ||
|
|
3eb9dbb55c | ||
|
|
9bd69a5032 | ||
|
|
d30357db5f | ||
|
|
bc313a999b | ||
|
|
442dd771a3 | ||
|
|
59b9e571a1 | ||
|
|
eefa74baaa | ||
|
|
fd2a8f84b9 | ||
|
|
bf30c7d437 | ||
|
|
882dcd44b5 | ||
|
|
b53d76ff3a | ||
|
|
93e63a6250 | ||
|
|
b84774388c | ||
|
|
a6580b33fe | ||
|
|
09530be51a | ||
|
|
dcb5f8ee4e | ||
|
|
e5ab96a306 | ||
|
|
67472b62c6 | ||
|
|
639ae479a8 | ||
|
|
cdedac9eda | ||
|
|
e85ccb3e36 | ||
|
|
f1627a9c96 | ||
|
|
82ee9f3599 | ||
|
|
f4b41c5793 | ||
|
|
c67dcfcc69 | ||
|
|
f8ca85cb5d | ||
|
|
4c034bd40f | ||
|
|
4b1f751adb | ||
|
|
7498d2e6e2 | ||
|
|
adaa2f5862 | ||
|
|
a761c769be | ||
|
|
6cc2bc64c0 | ||
|
|
314a334e88 | ||
|
|
830df29f73 | ||
|
|
5e9901c667 | ||
|
|
1a66846f9e | ||
|
|
408ffc0067 | ||
|
|
e983383e0e | ||
|
|
428d620203 | ||
|
|
de10a1d669 | ||
|
|
9029c70a99 | ||
|
|
3f818dc878 | ||
|
|
145ead7cec | ||
|
|
5c226319b0 | ||
|
|
81723ddf46 | ||
|
|
dd27a65960 | ||
|
|
978494c12c | ||
|
|
1f22299036 | ||
|
|
e78d3083c5 | ||
|
|
e0251bdb23 | ||
|
|
c5eaf34b4e | ||
|
|
a9d26084f9 | ||
|
|
2f75c68312 | ||
|
|
d2f8c73d31 | ||
|
|
7c176910d7 | ||
|
|
4237d40173 | ||
|
|
9f79016975 | ||
|
|
c0801afdbe | ||
|
|
b21b6b9859 | ||
|
|
43585ac194 | ||
|
|
4b06ca9147 | ||
|
|
7d3733ccb7 | ||
|
|
f5d4bc4f7b | ||
|
|
265fbf7e60 | ||
|
|
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 |
30
.github/workflows/api-tests.yml
vendored
Normal file
30
.github/workflows/api-tests.yml
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
name: API Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ['*']
|
||||
tags: ['*']
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-20.04
|
||||
# Only run on push events (not on pull_request) for security reasons in order to be able to use secrets
|
||||
if: ${{ github.event_name == 'push' }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Free space
|
||||
run: df -h && rm -rf /opt/hostedtoolcache* && df -h
|
||||
- name: Run API Tests
|
||||
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 QC_JOB_USER_ID=${{ secrets.QC_JOB_USER_ID }} -e QC_API_ACCESS_TOKEN=${{ secrets.QC_API_ACCESS_TOKEN }} -e QC_JOB_ORGANIZATION_ID=${{ secrets.QC_JOB_ORGANIZATION_ID }}
|
||||
shell: bash
|
||||
run: |
|
||||
# Build
|
||||
dotnet build /p:Configuration=Release /v:quiet /p:WarningLevel=1 QuantConnect.Lean.sln
|
||||
# Run Projects tests
|
||||
dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --blame-hang-timeout 300seconds --blame-crash --filter "FullyQualifiedName=QuantConnect.Tests.API.ProjectTests" -- TestRunParameters.Parameter\(name=\"log-handler\", value=\"ConsoleErrorLogHandler\"\)
|
||||
6
.github/workflows/gh-actions.yml
vendored
6
.github/workflows/gh-actions.yml
vendored
@@ -23,8 +23,8 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
# Build
|
||||
dotnet build /p:Configuration=Release /v:quiet /p:WarningLevel=1 QuantConnect.Lean.sln
|
||||
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\"\)
|
||||
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" && (([[ $GITHUB_REF = refs/tags/* ]] && chmod +x ci_build_stubs.sh && ./ci_build_stubs.sh -t -g -p) || echo "Skipping stub generation")
|
||||
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
|
||||
30
.github/workflows/report-generator.yml
vendored
Normal file
30
.github/workflows/report-generator.yml
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
name: Report Generator Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ['*']
|
||||
tags: ['*']
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Free space
|
||||
run: df -h && rm -rf /opt/hostedtoolcache* && df -h
|
||||
|
||||
- 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 Backtest
|
||||
cd ./Launcher/bin/Release && dotnet QuantConnect.Lean.Launcher.dll && cd ../../../
|
||||
# Run Report
|
||||
cd ./Report/bin/Release && dotnet ./QuantConnect.Report.dll --backtest-data-source-file ../../../Launcher/bin/Release/BasicTemplateFrameworkAlgorithm.json --close-automatically true
|
||||
6
.github/workflows/virtual-environments.yml
vendored
6
.github/workflows/virtual-environments.yml
vendored
@@ -34,14 +34,10 @@ jobs:
|
||||
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 Pomegranate & Neuralprophet Python Package Test
|
||||
dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.PomegranateTest|Neuralprophet" --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 NBeats Python Package Test
|
||||
dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.NBeatsTest" --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
|
||||
@@ -59,4 +55,4 @@ jobs:
|
||||
# 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
|
||||
dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.Transformers|XTransformers" --blame-hang-timeout 120seconds --blame-crash
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,3 +1,6 @@
|
||||
# OS Files
|
||||
.DS_Store
|
||||
|
||||
# Object files
|
||||
*.o
|
||||
*.ko
|
||||
|
||||
@@ -84,30 +84,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "199"},
|
||||
{"Total Orders", "199"},
|
||||
{"Average Win", "0.00%"},
|
||||
{"Average Loss", "0.00%"},
|
||||
{"Compounding Annual Return", "-12.611%"},
|
||||
{"Drawdown", "0.200%"},
|
||||
{"Expectancy", "-0.585"},
|
||||
{"Net Profit", "-0.172%"},
|
||||
{"Sharpe Ratio", "-10.169"},
|
||||
{"Sharpe Ratio", "-11.13"},
|
||||
{"Sortino Ratio", "-16.704"},
|
||||
{"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"},
|
||||
{"Portfolio Turnover", "119.89%"},
|
||||
{"OrderListHash", "3c4c4085810cc5ecdb927d3647b9bbf3"}
|
||||
{"OrderListHash", "2b4c6d1cb2fc32e25f9a744e8aa7229a"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,30 +120,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "9"},
|
||||
{"Total Orders", "9"},
|
||||
{"Average Win", "0.86%"},
|
||||
{"Average Loss", "-0.27%"},
|
||||
{"Compounding Annual Return", "184.364%"},
|
||||
{"Drawdown", "1.700%"},
|
||||
{"Expectancy", "1.781"},
|
||||
{"Net Profit", "1.442%"},
|
||||
{"Sharpe Ratio", "4.86"},
|
||||
{"Sharpe Ratio", "4.836"},
|
||||
{"Sortino Ratio", "10.481"},
|
||||
{"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"},
|
||||
{"Portfolio Turnover", "41.18%"},
|
||||
{"OrderListHash", "9da9afe1e9137638a55db1676adc2be1"}
|
||||
{"OrderListHash", "e07dec6ddf0ef6b5d9c791b0593ec4dc"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "0"},
|
||||
{"Total Orders", "0"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
@@ -105,6 +105,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "0"},
|
||||
{"Total Orders", "0"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
@@ -102,6 +102,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
|
||||
@@ -114,30 +114,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "1"},
|
||||
{"Total Orders", "3"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "12.939%"},
|
||||
{"Drawdown", "0.300%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0.289%"},
|
||||
{"Sharpe Ratio", "4.233"},
|
||||
{"Sharpe Ratio", "3.924"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"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"},
|
||||
{"Portfolio Turnover", "1.51%"},
|
||||
{"OrderListHash", "bd88c6a0e10c7e146b05377205101a12"}
|
||||
{"OrderListHash", "381bb9310f9dceb8a79a56849789bdab"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 63;
|
||||
public long DataPoints => 74;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -128,30 +128,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "3"},
|
||||
{"Total Orders", "3"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "-0.03%"},
|
||||
{"Compounding Annual Return", "-2.594%"},
|
||||
{"Drawdown", "0.000%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "-0.034%"},
|
||||
{"Sharpe Ratio", "-7.854"},
|
||||
{"Sharpe Ratio", "-10.666"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"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"},
|
||||
{"Portfolio Turnover", "66.80%"},
|
||||
{"OrderListHash", "802a335b5c355e83b8cd2174f053c1b9"}
|
||||
{"OrderListHash", "0ade3a7a7aaafa3263082c93cf17c4d8"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,30 +176,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "2"},
|
||||
{"Total Orders", "2"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "5512.811%"},
|
||||
{"Drawdown", "1.000%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "5.333%"},
|
||||
{"Sharpe Ratio", "64.137"},
|
||||
{"Sharpe Ratio", "64.084"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"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"},
|
||||
{"Portfolio Turnover", "122.11%"},
|
||||
{"OrderListHash", "e7021bd385f366771ae00abd3a46a22e"}
|
||||
{"OrderListHash", "679692e30a7cf3b54b09af766589df80"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 12164;
|
||||
public long DataPoints => 12170;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -105,19 +105,20 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "20"},
|
||||
{"Total Orders", "20"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "386219349.202%"},
|
||||
{"Drawdown", "5.200%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "11.912%"},
|
||||
{"Sharpe Ratio", "1604181.92"},
|
||||
{"Sharpe Ratio", "1604181.904"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"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"},
|
||||
@@ -128,7 +129,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Estimated Strategy Capacity", "$2600000.00"},
|
||||
{"Lowest Capacity Asset", "ES 31C3JQS9D84PW|ES XCZJLC9NOB29"},
|
||||
{"Portfolio Turnover", "495.15%"},
|
||||
{"OrderListHash", "64221a660525c4259d5bd852eef1299c"}
|
||||
{"OrderListHash", "51ae811a9f7a26ae8eb96cdcefe1ab59"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 608372;
|
||||
public long DataPoints => 608378;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -232,30 +232,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "2"},
|
||||
{"Total Orders", "2"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "347.065%"},
|
||||
{"Drawdown", "0.900%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "1.951%"},
|
||||
{"Sharpe Ratio", "15.548"},
|
||||
{"Sharpe Ratio", "15.402"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"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"},
|
||||
{"Portfolio Turnover", "32.31%"},
|
||||
{"OrderListHash", "738240babf741f1bf79f85ea5026ec4c"}
|
||||
{"OrderListHash", "8d248c2234fec09fbe09f86735fefd99"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,30 +129,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "3"},
|
||||
{"Total Orders", "3"},
|
||||
{"Average Win", "2.73%"},
|
||||
{"Average Loss", "-2.98%"},
|
||||
{"Compounding Annual Return", "-4.619%"},
|
||||
{"Drawdown", "0.300%"},
|
||||
{"Expectancy", "-0.042"},
|
||||
{"Net Profit", "-0.332%"},
|
||||
{"Sharpe Ratio", "-3.149"},
|
||||
{"Sharpe Ratio", "-4.614"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"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", "$5700000.00"},
|
||||
{"Lowest Capacity Asset", "AOL VRKS95ENLBYE|AOL R735QTJ8XC9X"},
|
||||
{"Portfolio Turnover", "0.55%"},
|
||||
{"OrderListHash", "568fe7c2a11960436660db1231f2cfd2"}
|
||||
{"OrderListHash", "f4c70895e766de85de883a25ca0b5c08"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -181,30 +181,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "2"},
|
||||
{"Total Orders", "2"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "-0.23%"},
|
||||
{"Compounding Annual Return", "-15.596%"},
|
||||
{"Drawdown", "0.200%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "-0.232%"},
|
||||
{"Sharpe Ratio", "-7.739"},
|
||||
{"Sharpe Ratio", "-8.903"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"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"},
|
||||
{"Portfolio Turnover", "1.14%"},
|
||||
{"OrderListHash", "ae0b430e9c728966e3736fb352a689c6"}
|
||||
{"OrderListHash", "99fd501dbd9e78656be9b32869fc32e0"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "2"},
|
||||
{"Total Orders", "2"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "-0.05%"},
|
||||
{"Compounding Annual Return", "-4.548%"},
|
||||
@@ -136,6 +136,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "-0.051%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -151,7 +152,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Estimated Strategy Capacity", "$30000.00"},
|
||||
{"Lowest Capacity Asset", "AAPL VXBK4Q9ZIFD2|AAPL R735QTJ8XC9X"},
|
||||
{"Portfolio Turnover", "0.07%"},
|
||||
{"OrderListHash", "546b6182e1df2d222178454d8f311566"}
|
||||
{"OrderListHash", "b01a993665c5333c37de9dbef0717e14"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "0"},
|
||||
{"Total Orders", "0"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
@@ -108,6 +108,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
// things like manually added, auto added, internal, and any other boolean state we need to track against a single security)
|
||||
throw new Exception("The underlying equity data should NEVER be removed in this algorithm because it was manually added");
|
||||
}
|
||||
if (_expectedSecurities.AreDifferent(Securities.Keys.ToHashSet()))
|
||||
if (_expectedSecurities.AreDifferent(Securities.Total.Select(x => x.Symbol).ToHashSet()))
|
||||
{
|
||||
var expected = string.Join(Environment.NewLine, _expectedSecurities.OrderBy(s => s.ToString()));
|
||||
var actual = string.Join(Environment.NewLine, Securities.Keys.OrderBy(s => s.ToString()));
|
||||
@@ -116,7 +116,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
}
|
||||
// find first put above market price
|
||||
return u.IncludeWeeklys()
|
||||
.Strikes(+1, +1)
|
||||
.Strikes(+1, +3)
|
||||
.Expiration(TimeSpan.Zero, TimeSpan.FromDays(1))
|
||||
.Contracts(c => c.Where(s => s.ID.OptionRight == OptionRight.Put));
|
||||
});
|
||||
@@ -141,16 +141,6 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
|
||||
public override void OnSecuritiesChanged(SecurityChanges changes)
|
||||
{
|
||||
if (changes.AddedSecurities.Count > 1)
|
||||
{
|
||||
// added event fired for underlying since it was added to the option chain universe
|
||||
if (changes.AddedSecurities.All(s => s.Symbol != Underlying))
|
||||
{
|
||||
var securities = string.Join(Environment.NewLine, changes.AddedSecurities.Select(s => s.Symbol));
|
||||
throw new Exception($"This algorithm intends to add a single security at a time but added: {changes.AddedSecurities.Count}{Environment.NewLine}{securities}");
|
||||
}
|
||||
}
|
||||
|
||||
if (changes.AddedSecurities.Any())
|
||||
{
|
||||
foreach (var added in changes.AddedSecurities)
|
||||
@@ -213,7 +203,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 200618;
|
||||
public long DataPoints => 200807;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -225,7 +215,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "6"},
|
||||
{"Total Orders", "6"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
@@ -233,6 +223,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -245,10 +236,10 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Tracking Error", "0"},
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$6.00"},
|
||||
{"Estimated Strategy Capacity", "$2000.00"},
|
||||
{"Estimated Strategy Capacity", "$3000.00"},
|
||||
{"Lowest Capacity Asset", "GOOCV 305RBR0BSWIX2|GOOCV VP83T1ZUHROL"},
|
||||
{"Portfolio Turnover", "1.19%"},
|
||||
{"OrderListHash", "550a99c482106defd8ba15f48183768e"}
|
||||
{"Portfolio Turnover", "1.49%"},
|
||||
{"OrderListHash", "3adcc7ebf4153baabb073a8152e8cb2b"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,30 +95,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "19"},
|
||||
{"Total Orders", "19"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0.00%"},
|
||||
{"Compounding Annual Return", "271.720%"},
|
||||
{"Drawdown", "2.500%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "1.754%"},
|
||||
{"Sharpe Ratio", "11.994"},
|
||||
{"Sharpe Ratio", "11.954"},
|
||||
{"Sortino Ratio", "29.606"},
|
||||
{"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"},
|
||||
{"Portfolio Turnover", "20.49%"},
|
||||
{"OrderListHash", "6ee62edf1ac883882b0fcef8cb3e9bae"}
|
||||
{"OrderListHash", "48d8e1195003665a2febf547c075d07f"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,30 +121,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "5"},
|
||||
{"Total Orders", "5"},
|
||||
{"Average Win", "0.46%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "296.356%"},
|
||||
{"Drawdown", "1.400%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "1.776%"},
|
||||
{"Sharpe Ratio", "13.013"},
|
||||
{"Sharpe Ratio", "12.966"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"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"},
|
||||
{"Portfolio Turnover", "29.88%"},
|
||||
{"OrderListHash", "ac3f4dfcdeb98b488b715412ad2d6c4f"}
|
||||
{"OrderListHash", "b26f2f30082b754b065c41bb0ace44cc"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,30 +74,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "3"},
|
||||
{"Total Orders", "3"},
|
||||
{"Average Win", "1.02%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "296.066%"},
|
||||
{"Drawdown", "2.200%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "1.775%"},
|
||||
{"Sharpe Ratio", "9.373"},
|
||||
{"Sharpe Ratio", "9.34"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"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"},
|
||||
{"Portfolio Turnover", "59.74%"},
|
||||
{"OrderListHash", "af3a9c98c190d1b6b36fad184e796b0b"}
|
||||
{"OrderListHash", "b5a7935f37d94eb20f6bcd88578dbaee"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "2"},
|
||||
{"Total Orders", "2"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
@@ -121,6 +121,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -136,7 +137,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Estimated Strategy Capacity", "$230000.00"},
|
||||
{"Lowest Capacity Asset", "AAPL VXBK4QQIRLZA|AAPL R735QTJ8XC9X"},
|
||||
{"Portfolio Turnover", "0.25%"},
|
||||
{"OrderListHash", "228194dcc6fd8689a67f383577ee2d85"}
|
||||
{"OrderListHash", "afec48c499382b1d01af22daafe9f648"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,30 +93,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "10"},
|
||||
{"Total Orders", "10"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "-0.01%"},
|
||||
{"Compounding Annual Return", "-14.233%"},
|
||||
{"Drawdown", "3.300%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "-0.168%"},
|
||||
{"Sharpe Ratio", "62.499"},
|
||||
{"Sharpe Ratio", "62.464"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "1.116"},
|
||||
{"Alpha", "1.117"},
|
||||
{"Beta", "1.19"},
|
||||
{"Annual Standard Deviation", "0.213"},
|
||||
{"Annual Variance", "0.046"},
|
||||
{"Information Ratio", "70.778"},
|
||||
{"Tracking Error", "0.043"},
|
||||
{"Treynor Ratio", "11.206"},
|
||||
{"Treynor Ratio", "11.2"},
|
||||
{"Total Fees", "$22.21"},
|
||||
{"Estimated Strategy Capacity", "$340000000.00"},
|
||||
{"Lowest Capacity Asset", "FB V6OIPNZEM8V9"},
|
||||
{"Portfolio Turnover", "26.92%"},
|
||||
{"OrderListHash", "a259afcf4ee1c65ce5d26588ab645dbf"}
|
||||
{"OrderListHash", "be09b39c5d01b0694f474ea7f7c5ae09"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,30 +104,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "21"},
|
||||
{"Total Orders", "23"},
|
||||
{"Average Win", "0.00%"},
|
||||
{"Average Loss", "-0.01%"},
|
||||
{"Compounding Annual Return", "-75.275%"},
|
||||
{"Drawdown", "5.800%"},
|
||||
{"Expectancy", "-0.609"},
|
||||
{"Net Profit", "-5.581%"},
|
||||
{"Sharpe Ratio", "-3.25"},
|
||||
{"Sharpe Ratio", "-3.288"},
|
||||
{"Sortino Ratio", "-3.828"},
|
||||
{"Probabilistic Sharpe Ratio", "5.546%"},
|
||||
{"Loss Rate", "73%"},
|
||||
{"Win Rate", "27%"},
|
||||
{"Profit-Loss Ratio", "0.43"},
|
||||
{"Alpha", "-0.498"},
|
||||
{"Alpha", "-0.495"},
|
||||
{"Beta", "1.484"},
|
||||
{"Annual Standard Deviation", "0.196"},
|
||||
{"Annual Variance", "0.039"},
|
||||
{"Information Ratio", "-3.843"},
|
||||
{"Tracking Error", "0.141"},
|
||||
{"Treynor Ratio", "-0.43"},
|
||||
{"Treynor Ratio", "-0.435"},
|
||||
{"Total Fees", "$31.25"},
|
||||
{"Estimated Strategy Capacity", "$550000000.00"},
|
||||
{"Lowest Capacity Asset", "AAPL R735QTJ8XC9X"},
|
||||
{"Portfolio Turnover", "7.33%"},
|
||||
{"OrderListHash", "6aab808e341ae46946b91ba378073531"}
|
||||
{"OrderListHash", "b2ec2148ac94b67038a5bb4a2655f0a6"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "1"},
|
||||
{"Total Orders", "1"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
@@ -176,6 +176,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -191,7 +192,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Estimated Strategy Capacity", "$42000000.00"},
|
||||
{"Lowest Capacity Asset", "AAPL R735QTJ8XC9X"},
|
||||
{"Portfolio Turnover", "99.56%"},
|
||||
{"OrderListHash", "18e41dded4f8cee548ee02b03ffb0814"}
|
||||
{"OrderListHash", "92cacc8a537ff29960b6d092c3f92cf1"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "0"},
|
||||
{"Total Orders", "0"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
@@ -90,6 +90,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
|
||||
@@ -171,13 +171,16 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{
|
||||
public AllShortableSymbolsRegressionAlgorithmBrokerageModel() : base()
|
||||
{
|
||||
ShortableProvider = new RegressionTestShortableProvider();
|
||||
}
|
||||
public override IShortableProvider GetShortableProvider(Security security)
|
||||
{
|
||||
return new RegressionTestShortableProvider();
|
||||
}
|
||||
}
|
||||
|
||||
private class RegressionTestShortableProvider : LocalDiskShortableProvider
|
||||
{
|
||||
public RegressionTestShortableProvider() : base(SecurityType.Equity, "testbrokerage", Market.USA)
|
||||
public RegressionTestShortableProvider() : base("testbrokerage")
|
||||
{
|
||||
}
|
||||
|
||||
@@ -188,6 +191,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <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 shortableDataDirectory = Path.Combine(Globals.DataFolder, SecurityType.Equity.SecurityTypeToLower(), Market.USA, "shortable", Brokerage);
|
||||
var allSymbols = new Dictionary<Symbol, long>();
|
||||
|
||||
// Check backwards up to one week to see if we can source a previous file.
|
||||
@@ -195,7 +199,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
var i = 0;
|
||||
while (i <= 7)
|
||||
{
|
||||
var shortableListFile = Path.Combine(ShortableDataDirectory.FullName, "dates", $"{localTime.AddDays(-i):yyyyMMdd}.csv");
|
||||
var shortableListFile = Path.Combine(shortableDataDirectory, "dates", $"{localTime.AddDays(-i):yyyyMMdd}.csv");
|
||||
|
||||
foreach (var line in DataProvider.ReadLines(shortableListFile))
|
||||
{
|
||||
@@ -231,7 +235,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
|
||||
@@ -248,30 +252,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "5"},
|
||||
{"Total Orders", "5"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "19.147%"},
|
||||
{"Drawdown", "0%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0.192%"},
|
||||
{"Sharpe Ratio", "231.673"},
|
||||
{"Sharpe Ratio", "221.176"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"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"},
|
||||
{"Portfolio Turnover", "10.61%"},
|
||||
{"OrderListHash", "0069f402ffcd2d91b9018b81badfab81"}
|
||||
{"OrderListHash", "9c129e856afe96579b52cbfe95237100"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,122 +0,0 @@
|
||||
/*
|
||||
* 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.Interfaces;
|
||||
using System.Collections.Generic;
|
||||
using QuantConnect.Data.UniverseSelection;
|
||||
using QuantConnect.Data.Custom.AlphaStreams;
|
||||
using QuantConnect.Algorithm.Framework.Alphas;
|
||||
using QuantConnect.Algorithm.Framework.Execution;
|
||||
using QuantConnect.Algorithm.Framework.Portfolio;
|
||||
using QuantConnect.Algorithm.Framework.Selection;
|
||||
|
||||
namespace QuantConnect.Algorithm.CSharp
|
||||
{
|
||||
/// <summary>
|
||||
/// Example algorithm consuming an alpha streams portfolio state and trading based on it
|
||||
/// </summary>
|
||||
public class AlphaStreamsUniverseSelectionTemplateAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition
|
||||
{
|
||||
/// <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(2018, 04, 04);
|
||||
SetEndDate(2018, 04, 06);
|
||||
|
||||
SetAlpha(new AlphaStreamAlphaModule());
|
||||
SetExecution(new ImmediateExecutionModel());
|
||||
Settings.MinimumOrderMarginPortfolioPercentage = 0.01m;
|
||||
SetPortfolioConstruction(new EqualWeightingAlphaStreamsPortfolioConstructionModel());
|
||||
|
||||
SetUniverseSelection(new ScheduledUniverseSelectionModel(
|
||||
DateRules.EveryDay(),
|
||||
TimeRules.Midnight,
|
||||
SelectAlphas,
|
||||
new UniverseSettings(UniverseSettings)
|
||||
{
|
||||
SubscriptionDataTypes = new List<Tuple<Type, TickType>>
|
||||
{new(typeof(AlphaStreamsPortfolioState), TickType.Trade)},
|
||||
FillForward = false,
|
||||
}
|
||||
));
|
||||
}
|
||||
|
||||
private IEnumerable<Symbol> SelectAlphas(DateTime dateTime)
|
||||
{
|
||||
Log($"SelectAlphas() {Time}");
|
||||
foreach (var alphaId in new[] {"623b06b231eb1cc1aa3643a46", "9fc8ef73792331b11dbd5429a"})
|
||||
{
|
||||
var alphaSymbol = new Symbol(SecurityIdentifier.GenerateBase(typeof(AlphaStreamsPortfolioState), alphaId, Market.USA),
|
||||
alphaId);
|
||||
|
||||
yield return alphaSymbol;
|
||||
}
|
||||
}
|
||||
|
||||
/// <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 };
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 893;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
/// </summary>
|
||||
public int AlgorithmHistoryDataPoints => 2;
|
||||
|
||||
/// <summary>
|
||||
/// This is used by the regression test system to indicate what the expected statistics are from running the algorithm
|
||||
/// </summary>
|
||||
public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "2"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "-0.12%"},
|
||||
{"Compounding Annual Return", "-13.200%"},
|
||||
{"Drawdown", "0.200%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "-0.116%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "0"},
|
||||
{"Beta", "0"},
|
||||
{"Annual Standard Deviation", "0"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "2.474"},
|
||||
{"Tracking Error", "0.339"},
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$83000.00"},
|
||||
{"Lowest Capacity Asset", "BTCUSD XJ"},
|
||||
{"Portfolio Turnover", "2.31%"},
|
||||
{"OrderListHash", "2b94bc50a74caebe06c075cdab1bc6da"}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,136 +0,0 @@
|
||||
/*
|
||||
* 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.Orders;
|
||||
using System.Collections.Generic;
|
||||
using QuantConnect.Data.Custom.AlphaStreams;
|
||||
using QuantConnect.Algorithm.Framework.Execution;
|
||||
using QuantConnect.Algorithm.Framework.Portfolio;
|
||||
|
||||
namespace QuantConnect.Algorithm.CSharp
|
||||
{
|
||||
/// <summary>
|
||||
/// Example algorithm with existing holdings consuming an alpha streams portfolio state and trading based on it
|
||||
/// </summary>
|
||||
public class AlphaStreamsWithHoldingsBasicTemplateAlgorithm : AlphaStreamsBasicTemplateAlgorithm
|
||||
{
|
||||
private decimal _expectedSpyQuantity;
|
||||
/// <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(2018, 04, 04);
|
||||
SetEndDate(2018, 04, 06);
|
||||
SetCash(100000);
|
||||
|
||||
SetExecution(new ImmediateExecutionModel());
|
||||
UniverseSettings.Resolution = Resolution.Hour;
|
||||
Settings.MinimumOrderMarginPortfolioPercentage = 0.001m;
|
||||
SetPortfolioConstruction(new EqualWeightingAlphaStreamsPortfolioConstructionModel());
|
||||
|
||||
// AAPL should be liquidated since it's not hold by the alpha
|
||||
// This is handled by the PCM
|
||||
var aapl = AddEquity("AAPL", Resolution.Hour);
|
||||
aapl.Holdings.SetHoldings(40, 10);
|
||||
|
||||
// SPY will be bought following the alpha streams portfolio
|
||||
// This is handled by the PCM + Execution Model
|
||||
var spy = AddEquity("SPY", Resolution.Hour);
|
||||
spy.Holdings.SetHoldings(246, -10);
|
||||
|
||||
AddData<AlphaStreamsPortfolioState>("94d820a93fff127fa46c15231d");
|
||||
}
|
||||
|
||||
public override void OnOrderEvent(OrderEvent orderEvent)
|
||||
{
|
||||
if (_expectedSpyQuantity == 0 && orderEvent.Symbol == "SPY" && orderEvent.Status == OrderStatus.Filled)
|
||||
{
|
||||
var security = Securities["SPY"];
|
||||
var priceInAccountCurrency = Portfolio.CashBook.ConvertToAccountCurrency(security.AskPrice, security.QuoteCurrency.Symbol);
|
||||
_expectedSpyQuantity = Portfolio.TotalPortfolioValueLessFreeBuffer / priceInAccountCurrency;
|
||||
_expectedSpyQuantity = _expectedSpyQuantity.DiscretelyRoundBy(1, MidpointRounding.ToZero);
|
||||
}
|
||||
|
||||
base.OnOrderEvent(orderEvent);
|
||||
}
|
||||
|
||||
public override void OnEndOfAlgorithm()
|
||||
{
|
||||
if (Securities["AAPL"].HoldStock)
|
||||
{
|
||||
throw new Exception("We should no longer hold AAPL since the alpha does not");
|
||||
}
|
||||
|
||||
// we allow some padding for small price differences
|
||||
if (Math.Abs(Securities["SPY"].Holdings.Quantity - _expectedSpyQuantity) > _expectedSpyQuantity * 0.03m)
|
||||
{
|
||||
throw new Exception($"Unexpected SPY holdings. Expected {_expectedSpyQuantity} was {Securities["SPY"].Holdings.Quantity}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <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 };
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public override long DataPoints => 2313;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
/// </summary>
|
||||
public override int AlgorithmHistoryDataPoints => 1;
|
||||
|
||||
/// <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", "2"},
|
||||
{"Average Win", "0.01%"},
|
||||
{"Average Loss", "0.00%"},
|
||||
{"Compounding Annual Return", "-87.617%"},
|
||||
{"Drawdown", "3.100%"},
|
||||
{"Expectancy", "8.518"},
|
||||
{"Net Profit", "-1.515%"},
|
||||
{"Sharpe Ratio", "-2.45"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "50%"},
|
||||
{"Win Rate", "50%"},
|
||||
{"Profit-Loss Ratio", "18.04"},
|
||||
{"Alpha", "0.008"},
|
||||
{"Beta", "1.015"},
|
||||
{"Annual Standard Deviation", "0.344"},
|
||||
{"Annual Variance", "0.118"},
|
||||
{"Information Ratio", "-0.856"},
|
||||
{"Tracking Error", "0.005"},
|
||||
{"Treynor Ratio", "-0.83"},
|
||||
{"Total Fees", "$3.09"},
|
||||
{"Estimated Strategy Capacity", "$8900000000.00"},
|
||||
{"Lowest Capacity Asset", "AAPL R735QTJ8XC9X"},
|
||||
{"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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace QuantConnect.Algorithm.CSharp.Alphas
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "2465"},
|
||||
{"Total Orders", "2465"},
|
||||
{"Average Win", "0.26%"},
|
||||
{"Average Loss", "-0.24%"},
|
||||
{"Compounding Annual Return", "7.848%"},
|
||||
|
||||
33
Algorithm.CSharp/AsynchronousUniverseRegressionAlgorithm.cs
Normal file
33
Algorithm.CSharp/AsynchronousUniverseRegressionAlgorithm.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
namespace QuantConnect.Algorithm.CSharp
|
||||
{
|
||||
/// <summary>
|
||||
/// Example algorithm using the asynchronous universe selection functionality
|
||||
/// </summary>
|
||||
public class AsynchronousUniverseRegressionAlgorithm : FundamentalRegressionAlgorithm
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
UniverseSettings.Asynchronous = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -88,30 +88,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "52"},
|
||||
{"Total Orders", "52"},
|
||||
{"Average Win", "0.00%"},
|
||||
{"Average Loss", "0.00%"},
|
||||
{"Compounding Annual Return", "0.096%"},
|
||||
{"Drawdown", "0.100%"},
|
||||
{"Expectancy", "3.321"},
|
||||
{"Net Profit", "0.089%"},
|
||||
{"Sharpe Ratio", "0.798"},
|
||||
{"Sharpe Ratio", "-8.214"},
|
||||
{"Sortino Ratio", "-9.025"},
|
||||
{"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"},
|
||||
{"Portfolio Turnover", "0.02%"},
|
||||
{"OrderListHash", "cf43585a8d1781f04b53a4f1ee3380cb"}
|
||||
{"OrderListHash", "e6711c76cb05bbb575ca067664348d88"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,30 +158,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "1"},
|
||||
{"Total Orders", "1"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "733913.744%"},
|
||||
{"Drawdown", "15.900%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "6.828%"},
|
||||
{"Sharpe Ratio", "203744786353.302"},
|
||||
{"Sharpe Ratio", "203744786353.299"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"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"},
|
||||
{"Portfolio Turnover", "351.80%"},
|
||||
{"OrderListHash", "dd38e7b94027d20942a5aa9ac31a9a7f"}
|
||||
{"OrderListHash", "23cf084b30ec3d70b1b9f54c9b3b975f"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,14 +120,15 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "1"},
|
||||
{"Total Orders", "1"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "271.453%"},
|
||||
{"Drawdown", "2.200%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "1.692%"},
|
||||
{"Sharpe Ratio", "8.888"},
|
||||
{"Sharpe Ratio", "8.854"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "67.609%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -138,12 +139,12 @@ 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"},
|
||||
{"Portfolio Turnover", "19.93%"},
|
||||
{"OrderListHash", "9e4bfd2eb0b81ee5bc1b197a87ccedbe"}
|
||||
{"OrderListHash", "0c0f9328786b0c9e8f88d271673d16c3"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -296,7 +296,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 1272232;
|
||||
public long DataPoints => 1267414;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -308,30 +308,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "3"},
|
||||
{"Total Orders", "3"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "-0.40%"},
|
||||
{"Compounding Annual Return", "-22.717%"},
|
||||
{"Drawdown", "0.400%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "-0.329%"},
|
||||
{"Sharpe Ratio", "-7.887"},
|
||||
{"Sharpe Ratio", "-14.095"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"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"},
|
||||
{"Portfolio Turnover", "17.02%"},
|
||||
{"OrderListHash", "85cbf92f01c2c91b5f710b7eeefecbe1"}
|
||||
{"OrderListHash", "774204888824c3df9182b17dd7b55a2e"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "1"},
|
||||
{"Total Orders", "1"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
@@ -92,6 +92,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -105,9 +106,9 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "€298.35"},
|
||||
{"Estimated Strategy Capacity", "€85000.00"},
|
||||
{"Lowest Capacity Asset", "BTCEUR XJ"},
|
||||
{"Lowest Capacity Asset", "BTCEUR 2XR"},
|
||||
{"Portfolio Turnover", "107.64%"},
|
||||
{"OrderListHash", "2ba443899dcccc79dc0f04441f797bf9"}
|
||||
{"OrderListHash", "b0544d71cee600ef1f09c6000d6a3229"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "1"},
|
||||
{"Total Orders", "1"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
@@ -62,6 +62,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -75,9 +76,9 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "€596.71"},
|
||||
{"Estimated Strategy Capacity", "€85000.00"},
|
||||
{"Lowest Capacity Asset", "BTCEUR XJ"},
|
||||
{"Lowest Capacity Asset", "BTCEUR 2XR"},
|
||||
{"Portfolio Turnover", "107.64%"},
|
||||
{"OrderListHash", "af1850fbc1faefaf2da98080e92c43a0"}
|
||||
{"OrderListHash", "64c44a56824e67b86213539212d08e25"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,14 +87,15 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "1"},
|
||||
{"Total Orders", "1"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "271.453%"},
|
||||
{"Drawdown", "2.200%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "1.692%"},
|
||||
{"Sharpe Ratio", "8.888"},
|
||||
{"Sharpe Ratio", "8.854"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "67.609%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -105,12 +106,12 @@ 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"},
|
||||
{"Portfolio Turnover", "19.93%"},
|
||||
{"OrderListHash", "9e4bfd2eb0b81ee5bc1b197a87ccedbe"}
|
||||
{"OrderListHash", "0c0f9328786b0c9e8f88d271673d16c3"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
*/
|
||||
|
||||
using QuantConnect.Data;
|
||||
using QuantConnect.Orders;
|
||||
using QuantConnect.Interfaces;
|
||||
using QuantConnect.Brokerages;
|
||||
using System.Collections.Generic;
|
||||
@@ -22,12 +21,12 @@ using System.Collections.Generic;
|
||||
namespace QuantConnect.Algorithm.CSharp
|
||||
{
|
||||
/// <summary>
|
||||
/// Basic template algorithm for the Atreyu brokerage
|
||||
/// Basic template algorithm for the Axos brokerage
|
||||
/// </summary>
|
||||
/// <meta name="tag" content="using data" />
|
||||
/// <meta name="tag" content="using quantconnect" />
|
||||
/// <meta name="tag" content="trading and orders" />
|
||||
public class BasicTemplateAtreyuAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition
|
||||
public class BasicTemplateAxosAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition
|
||||
{
|
||||
/// <summary>
|
||||
/// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.
|
||||
@@ -38,14 +37,8 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
SetEndDate(2013, 10, 11);
|
||||
SetCash(100000);
|
||||
|
||||
SetBrokerageModel(BrokerageName.Atreyu);
|
||||
SetBrokerageModel(BrokerageName.Axos);
|
||||
AddEquity("SPY", Resolution.Minute);
|
||||
|
||||
DefaultOrderProperties = new AtreyuOrderProperties
|
||||
{
|
||||
// Currently only support order for the day
|
||||
TimeInForce = TimeInForce.Day
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -88,14 +81,15 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "1"},
|
||||
{"Total Orders", "1"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "39.143%"},
|
||||
{"Drawdown", "0.500%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0.423%"},
|
||||
{"Sharpe Ratio", "5.634"},
|
||||
{"Sharpe Ratio", "5.498"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "67.498%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -111,7 +105,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Estimated Strategy Capacity", "$150000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Portfolio Turnover", "4.98%"},
|
||||
{"OrderListHash", "d549c64ee7f5e3866712b3c7dbd64caa"}
|
||||
{"OrderListHash", "c198b0d9bf2b4c41d69c7ea4750f09b5"}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -118,7 +118,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 703956;
|
||||
public long DataPoints => 713395;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -130,30 +130,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "3"},
|
||||
{"Average Win", "5.51%"},
|
||||
{"Total Orders", "5"},
|
||||
{"Average Win", "2.90%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "12.437%"},
|
||||
{"Drawdown", "1.500%"},
|
||||
{"Compounding Annual Return", "13.087%"},
|
||||
{"Drawdown", "1.100%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "6.079%"},
|
||||
{"Sharpe Ratio", "1.604"},
|
||||
{"Probabilistic Sharpe Ratio", "88.038%"},
|
||||
{"Net Profit", "6.387%"},
|
||||
{"Sharpe Ratio", "1.532"},
|
||||
{"Sortino Ratio", "871.704"},
|
||||
{"Probabilistic Sharpe Ratio", "90.613%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "100%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "0.091"},
|
||||
{"Beta", "-0.02"},
|
||||
{"Alpha", "0.088"},
|
||||
{"Beta", "-0.022"},
|
||||
{"Annual Standard Deviation", "0.054"},
|
||||
{"Annual Variance", "0.003"},
|
||||
{"Information Ratio", "-1.399"},
|
||||
{"Tracking Error", "0.099"},
|
||||
{"Treynor Ratio", "-4.276"},
|
||||
{"Total Fees", "$6.45"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Information Ratio", "-1.35"},
|
||||
{"Tracking Error", "0.1"},
|
||||
{"Treynor Ratio", "-3.781"},
|
||||
{"Total Fees", "$10.75"},
|
||||
{"Estimated Strategy Capacity", "$1100000000.00"},
|
||||
{"Lowest Capacity Asset", "ES VMKLFZIH2MTD"},
|
||||
{"Portfolio Turnover", "1.39%"},
|
||||
{"OrderListHash", "624c51bc6451dfb74335b99c04e3ed16"}
|
||||
{"Portfolio Turnover", "2.32%"},
|
||||
{"OrderListHash", "c42bb4b319557346b155cd2c06ade894"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 2169065;
|
||||
public long DataPoints => 2217325;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -135,30 +135,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "5"},
|
||||
{"Total Orders", "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", "1.089"},
|
||||
{"Sharpe Ratio", "0.951"},
|
||||
{"Sortino Ratio", "2.8"},
|
||||
{"Probabilistic Sharpe Ratio", "53.568%"},
|
||||
{"Loss Rate", "50%"},
|
||||
{"Win Rate", "50%"},
|
||||
{"Profit-Loss Ratio", "17.40"},
|
||||
{"Alpha", "0.06"},
|
||||
{"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", "-11.74"},
|
||||
{"Treynor Ratio", "-10.255"},
|
||||
{"Total Fees", "$10.75"},
|
||||
{"Estimated Strategy Capacity", "$190000000.00"},
|
||||
{"Lowest Capacity Asset", "ES VMKLFZIH2MTD"},
|
||||
{"Portfolio Turnover", "2.34%"},
|
||||
{"OrderListHash", "2a0aa0c11df66d81ebf0f7b3e9048bbc"}
|
||||
{"OrderListHash", "8a6ad6061fc3c311934a0801c26744eb"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "10"},
|
||||
{"Total Orders", "12"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
@@ -221,6 +221,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -234,9 +235,9 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$85.34"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", "BTCEUR XJ"},
|
||||
{"Lowest Capacity Asset", "BTCEUR 2XR"},
|
||||
{"Portfolio Turnover", "118.08%"},
|
||||
{"OrderListHash", "1bf1a6d9dd921982b72a6178f9e50e68"}
|
||||
{"OrderListHash", "77458586d24f1cd00623d63da8279be2"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "4"},
|
||||
{"Total Orders", "5"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
@@ -253,6 +253,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -268,7 +269,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Estimated Strategy Capacity", "$500000000.00"},
|
||||
{"Lowest Capacity Asset", "ADAUSDT 18R"},
|
||||
{"Portfolio Turnover", "0.16%"},
|
||||
{"OrderListHash", "254f39d98378b1e7aa397b1f1e49c6cc"}
|
||||
{"OrderListHash", "ed329700a93491ffe30354769767c6aa"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "2"},
|
||||
{"Total Orders", "3"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
@@ -216,6 +216,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -231,7 +232,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Estimated Strategy Capacity", "$370000000.00"},
|
||||
{"Lowest Capacity Asset", "ADAUSDT 18R"},
|
||||
{"Portfolio Turnover", "0.12%"},
|
||||
{"OrderListHash", "d2c6198197a4d18fa0a81f5933d935a6"}
|
||||
{"OrderListHash", "5b1290390c34b0e64ac0b9e834c27b07"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,14 +78,15 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "1"},
|
||||
{"Total Orders", "1"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "246.546%"},
|
||||
{"Drawdown", "1.200%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "3.464%"},
|
||||
{"Sharpe Ratio", "19.148"},
|
||||
{"Sharpe Ratio", "19.094"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "97.754%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -96,12 +97,12 @@ 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"},
|
||||
{"Portfolio Turnover", "10.09%"},
|
||||
{"OrderListHash", "33d01821923c397f999cfb2e5b5928ad"}
|
||||
{"OrderListHash", "418c8ec9920ec61bdefa2d02a8557048"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,14 +99,15 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "3"},
|
||||
{"Total Orders", "3"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "-1.01%"},
|
||||
{"Compounding Annual Return", "261.134%"},
|
||||
{"Drawdown", "2.200%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "1.655%"},
|
||||
{"Sharpe Ratio", "8.505"},
|
||||
{"Sharpe Ratio", "8.472"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "66.840%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -117,12 +118,12 @@ 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"},
|
||||
{"Portfolio Turnover", "59.86%"},
|
||||
{"OrderListHash", "ad2216297c759d8e5aef48ff065f8919"}
|
||||
{"OrderListHash", "75c4c7221e2e70d0aa5c9844aae9009c"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 1332;
|
||||
public long DataPoints => 1334;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -188,30 +188,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "2"},
|
||||
{"Total Orders", "2"},
|
||||
{"Average Win", "0.53%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "3.011%"},
|
||||
{"Drawdown", "0.000%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0.528%"},
|
||||
{"Sharpe Ratio", "1.999"},
|
||||
{"Sharpe Ratio", "1.285"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"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"},
|
||||
{"Portfolio Turnover", "0.27%"},
|
||||
{"OrderListHash", "40e4b91ec89383f6501d9ba324e50eb9"}
|
||||
{"OrderListHash", "9fb6d9433c29815301d818ccd7f3863f"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 75401;
|
||||
public long DataPoints => 75403;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -163,30 +163,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "2700"},
|
||||
{"Total Orders", "2700"},
|
||||
{"Average Win", "0.00%"},
|
||||
{"Average Loss", "0.00%"},
|
||||
{"Compounding Annual Return", "-99.777%"},
|
||||
{"Drawdown", "4.400%"},
|
||||
{"Expectancy", "-0.724"},
|
||||
{"Net Profit", "-4.430%"},
|
||||
{"Sharpe Ratio", "-31.389"},
|
||||
{"Sharpe Ratio", "-31.63"},
|
||||
{"Sortino 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"},
|
||||
{"Portfolio Turnover", "9912.69%"},
|
||||
{"OrderListHash", "8f92e1528c6477a156449fd1e86527e7"}
|
||||
{"OrderListHash", "398c0383a9ba3235f15ac472a7fbcb8a"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public virtual long DataPoints => 13948;
|
||||
public virtual long DataPoints => 14038;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -129,30 +129,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "122"},
|
||||
{"Average Win", "0.09%"},
|
||||
{"Total Orders", "128"},
|
||||
{"Average Win", "0.26%"},
|
||||
{"Average Loss", "-0.01%"},
|
||||
{"Compounding Annual Return", "-0.486%"},
|
||||
{"Drawdown", "0.500%"},
|
||||
{"Expectancy", "-0.837"},
|
||||
{"Net Profit", "-0.490%"},
|
||||
{"Sharpe Ratio", "-1.968"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "98%"},
|
||||
{"Win Rate", "2%"},
|
||||
{"Profit-Loss Ratio", "8.94"},
|
||||
{"Alpha", "-0.003"},
|
||||
{"Beta", "-0.001"},
|
||||
{"Annual Standard Deviation", "0.002"},
|
||||
{"Compounding Annual Return", "-0.071%"},
|
||||
{"Drawdown", "0.400%"},
|
||||
{"Expectancy", "-0.116"},
|
||||
{"Net Profit", "-0.071%"},
|
||||
{"Sharpe Ratio", "-1.999"},
|
||||
{"Sortino Ratio", "-1.806"},
|
||||
{"Probabilistic Sharpe Ratio", "10.091%"},
|
||||
{"Loss Rate", "97%"},
|
||||
{"Win Rate", "3%"},
|
||||
{"Profit-Loss Ratio", "27.29"},
|
||||
{"Alpha", "-0.008"},
|
||||
{"Beta", "0.001"},
|
||||
{"Annual Standard Deviation", "0.004"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-1.397"},
|
||||
{"Information Ratio", "-1.367"},
|
||||
{"Tracking Error", "0.089"},
|
||||
{"Treynor Ratio", "5.001"},
|
||||
{"Total Fees", "$272.54"},
|
||||
{"Treynor Ratio", "-5.445"},
|
||||
{"Total Fees", "$285.44"},
|
||||
{"Estimated Strategy Capacity", "$1000.00"},
|
||||
{"Lowest Capacity Asset", "ES VRJST036ZY0X"},
|
||||
{"Portfolio Turnover", "3.27%"},
|
||||
{"OrderListHash", "61ad5bfa7e2135a85a82c986329335cf"}
|
||||
{"Portfolio Turnover", "3.41%"},
|
||||
{"OrderListHash", "1666cd6c277c6ea8b1b46d5dfa6bac9f"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public virtual long DataPoints => 57752;
|
||||
public virtual long DataPoints => 57754;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -148,30 +148,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "2"},
|
||||
{"Total Orders", "2"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "-81.734%"},
|
||||
{"Drawdown", "4.100%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "-2.169%"},
|
||||
{"Sharpe Ratio", "-10.195"},
|
||||
{"Sharpe Ratio", "-10.299"},
|
||||
{"Sortino 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"},
|
||||
{"Portfolio Turnover", "43.23%"},
|
||||
{"OrderListHash", "323b899ae80aa839e320806411665ce7"}
|
||||
{"OrderListHash", "1daca8b4534258de0f1bf09214205b77"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,37 +41,38 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public override long DataPoints => 163392;
|
||||
public override long DataPoints => 163410;
|
||||
|
||||
/// <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", "2"},
|
||||
{"Total Orders", "2"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "-92.667%"},
|
||||
{"Drawdown", "5.000%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "-3.314%"},
|
||||
{"Sharpe Ratio", "-6.303"},
|
||||
{"Sharpe Ratio", "-6.359"},
|
||||
{"Sortino Ratio", "-11.237"},
|
||||
{"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"},
|
||||
{"Portfolio Turnover", "43.77%"},
|
||||
{"OrderListHash", "18ffd3a774c68da83d867e3b09e3e05d"}
|
||||
{"OrderListHash", "ba6e16f476a2ddeeaab9c9091664f7a1"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public virtual long DataPoints => 48688;
|
||||
public virtual long DataPoints => 48690;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -152,7 +152,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "0"},
|
||||
{"Total Orders", "0"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
@@ -160,6 +160,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public override long DataPoints => 147769;
|
||||
public override long DataPoints => 147771;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -59,7 +59,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "0"},
|
||||
{"Total Orders", "0"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
@@ -67,6 +67,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
|
||||
@@ -41,37 +41,38 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public override long DataPoints => 86963;
|
||||
public override long DataPoints => 87393;
|
||||
|
||||
/// <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", "636"},
|
||||
{"Total Orders", "638"},
|
||||
{"Average Win", "0.02%"},
|
||||
{"Average Loss", "-0.01%"},
|
||||
{"Compounding Annual Return", "-1.606%"},
|
||||
{"Compounding Annual Return", "-1.610%"},
|
||||
{"Drawdown", "1.600%"},
|
||||
{"Expectancy", "-0.841"},
|
||||
{"Net Profit", "-1.617%"},
|
||||
{"Sharpe Ratio", "-5.092"},
|
||||
{"Net Profit", "-1.622%"},
|
||||
{"Sharpe Ratio", "-8.787"},
|
||||
{"Sortino Ratio", "-5.428"},
|
||||
{"Probabilistic Sharpe Ratio", "0.000%"},
|
||||
{"Loss Rate", "96%"},
|
||||
{"Win Rate", "4%"},
|
||||
{"Profit-Loss Ratio", "3.21"},
|
||||
{"Alpha", "-0.01"},
|
||||
{"Alpha", "-0.018"},
|
||||
{"Beta", "-0.003"},
|
||||
{"Annual Standard Deviation", "0.002"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-1.473"},
|
||||
{"Tracking Error", "0.089"},
|
||||
{"Treynor Ratio", "3.137"},
|
||||
{"Total Fees", "$1451.88"},
|
||||
{"Treynor Ratio", "5.593"},
|
||||
{"Total Fees", "$1456.18"},
|
||||
{"Estimated Strategy Capacity", "$9000.00"},
|
||||
{"Lowest Capacity Asset", "ES VP274HSU1AF5"},
|
||||
{"Portfolio Turnover", "17.86%"},
|
||||
{"OrderListHash", "de6a834d1b5e7aeb40f6cf9dba16782d"}
|
||||
{"Portfolio Turnover", "17.91%"},
|
||||
{"OrderListHash", "19d70e24c5d0922d1557de4adbf60ab5"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 224660;
|
||||
public long DataPoints => 224662;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -163,30 +163,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "8282"},
|
||||
{"Total Orders", "8282"},
|
||||
{"Average Win", "0.00%"},
|
||||
{"Average Loss", "0.00%"},
|
||||
{"Compounding Annual Return", "-100.000%"},
|
||||
{"Drawdown", "13.900%"},
|
||||
{"Expectancy", "-0.824"},
|
||||
{"Net Profit", "-13.874%"},
|
||||
{"Sharpe Ratio", "-19.202"},
|
||||
{"Sharpe Ratio", "-19.346"},
|
||||
{"Sortino 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"},
|
||||
{"Portfolio Turnover", "32523.20%"},
|
||||
{"OrderListHash", "85cdd035d7c7a3da178d1c2dff31f1bd"}
|
||||
{"OrderListHash", "584fbdabd837921edc6a7e99759b9c66"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,37 +43,38 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public override long DataPoints => 16247;
|
||||
public override long DataPoints => 16265;
|
||||
|
||||
/// <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", "152"},
|
||||
{"Average Win", "0.09%"},
|
||||
{"Total Orders", "156"},
|
||||
{"Average Win", "0.31%"},
|
||||
{"Average Loss", "-0.01%"},
|
||||
{"Compounding Annual Return", "-0.644%"},
|
||||
{"Drawdown", "0.600%"},
|
||||
{"Expectancy", "-0.872"},
|
||||
{"Net Profit", "-0.649%"},
|
||||
{"Sharpe Ratio", "-2.343"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "99%"},
|
||||
{"Win Rate", "1%"},
|
||||
{"Profit-Loss Ratio", "8.76"},
|
||||
{"Alpha", "-0.004"},
|
||||
{"Compounding Annual Return", "-0.024%"},
|
||||
{"Drawdown", "0.400%"},
|
||||
{"Expectancy", "-0.035"},
|
||||
{"Net Profit", "-0.025%"},
|
||||
{"Sharpe Ratio", "-1.602"},
|
||||
{"Sortino Ratio", "-1.913"},
|
||||
{"Probabilistic Sharpe Ratio", "11.172%"},
|
||||
{"Loss Rate", "97%"},
|
||||
{"Win Rate", "3%"},
|
||||
{"Profit-Loss Ratio", "36.65"},
|
||||
{"Alpha", "-0.007"},
|
||||
{"Beta", "-0.001"},
|
||||
{"Annual Standard Deviation", "0.002"},
|
||||
{"Annual Standard Deviation", "0.005"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-1.409"},
|
||||
{"Information Ratio", "-1.359"},
|
||||
{"Tracking Error", "0.089"},
|
||||
{"Treynor Ratio", "3.76"},
|
||||
{"Total Fees", "$338.96"},
|
||||
{"Treynor Ratio", "8.008"},
|
||||
{"Total Fees", "$347.56"},
|
||||
{"Estimated Strategy Capacity", "$1000.00"},
|
||||
{"Lowest Capacity Asset", "ES VRJST036ZY0X"},
|
||||
{"Portfolio Turnover", "4.07%"},
|
||||
{"OrderListHash", "e2d7f858dcad2d760f776bec1065b2f1"}
|
||||
{"Portfolio Turnover", "4.16%"},
|
||||
{"OrderListHash", "ce63f5e611a7ab2f49d49c9fdc777ef5"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,37 +41,38 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public override long DataPoints => 227220;
|
||||
public override long DataPoints => 228938;
|
||||
|
||||
/// <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", "1970"},
|
||||
{"Total Orders", "1990"},
|
||||
{"Average Win", "0.01%"},
|
||||
{"Average Loss", "-0.01%"},
|
||||
{"Compounding Annual Return", "-4.641%"},
|
||||
{"Compounding Annual Return", "-4.683%"},
|
||||
{"Drawdown", "4.700%"},
|
||||
{"Expectancy", "-0.911"},
|
||||
{"Net Profit", "-4.675%"},
|
||||
{"Sharpe Ratio", "-5.76"},
|
||||
{"Net Profit", "-4.717%"},
|
||||
{"Sharpe Ratio", "-7.178"},
|
||||
{"Sortino Ratio", "-5.126"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "97%"},
|
||||
{"Win Rate", "3%"},
|
||||
{"Profit-Loss Ratio", "2.04"},
|
||||
{"Alpha", "-0.03"},
|
||||
{"Alpha", "-0.038"},
|
||||
{"Beta", "-0.008"},
|
||||
{"Annual Standard Deviation", "0.005"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-1.699"},
|
||||
{"Information Ratio", "-1.702"},
|
||||
{"Tracking Error", "0.09"},
|
||||
{"Treynor Ratio", "4.067"},
|
||||
{"Total Fees", "$4495.98"},
|
||||
{"Treynor Ratio", "5.049"},
|
||||
{"Total Fees", "$4538.98"},
|
||||
{"Estimated Strategy Capacity", "$3000.00"},
|
||||
{"Lowest Capacity Asset", "ES VP274HSU1AF5"},
|
||||
{"Portfolio Turnover", "56.20%"},
|
||||
{"OrderListHash", "e65e1dace0d1679c2026155628ca3077"}
|
||||
{"Portfolio Turnover", "56.68%"},
|
||||
{"OrderListHash", "4ebc10fed9201f59aa7fcd90fbb49448"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,14 +87,15 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "1"},
|
||||
{"Total Orders", "1"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "227.693%"},
|
||||
{"Drawdown", "2.000%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "1.529%"},
|
||||
{"Sharpe Ratio", "8.889"},
|
||||
{"Sharpe Ratio", "8.855"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "67.609%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -105,12 +106,12 @@ 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"},
|
||||
{"Portfolio Turnover", "19.96%"},
|
||||
{"OrderListHash", "f409be3a7c63d9c1394c2e6c005a15ee"}
|
||||
{"OrderListHash", "0f357e8eeee4108d6b53f2b671e97f29"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,30 +124,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "3"},
|
||||
{"Total Orders", "3"},
|
||||
{"Average Win", "6.15%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "435.569%"},
|
||||
{"Drawdown", "3.400%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "5.516%"},
|
||||
{"Sharpe Ratio", "-6.262"},
|
||||
{"Sharpe Ratio", "-6.336"},
|
||||
{"Sortino Ratio", "-12.182"},
|
||||
{"Probabilistic Sharpe Ratio", "0.011%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "100%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "-0.223"},
|
||||
{"Alpha", "-0.226"},
|
||||
{"Beta", "0.02"},
|
||||
{"Annual Standard Deviation", "0.034"},
|
||||
{"Annual Variance", "0.001"},
|
||||
{"Information Ratio", "-7.032"},
|
||||
{"Tracking Error", "0.107"},
|
||||
{"Treynor Ratio", "-10.779"},
|
||||
{"Treynor Ratio", "-10.906"},
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$3000.00"},
|
||||
{"Lowest Capacity Asset", "SPX XL80P3GHDZXQ|SPX 31"},
|
||||
{"Portfolio Turnover", "24.07%"},
|
||||
{"OrderListHash", "5dbee236086bb2c39e2fbeac068280fd"}
|
||||
{"OrderListHash", "d1987f604e6d61584838ccc94adf7256"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,30 +35,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "71"},
|
||||
{"Total Orders", "81"},
|
||||
{"Average Win", "1.28%"},
|
||||
{"Average Loss", "-0.06%"},
|
||||
{"Compounding Annual Return", "-20.546%"},
|
||||
{"Drawdown", "1.800%"},
|
||||
{"Expectancy", "-0.402"},
|
||||
{"Net Profit", "-0.922%"},
|
||||
{"Sharpe Ratio", "-2.856"},
|
||||
{"Sharpe Ratio", "-2.903"},
|
||||
{"Sortino Ratio", "-6.081"},
|
||||
{"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", "$300000.00"},
|
||||
{"Lowest Capacity Asset", "SPX XL80P3GHDZXQ|SPX 31"},
|
||||
{"Portfolio Turnover", "24.63%"},
|
||||
{"OrderListHash", "9e974939d13fd3255c6291a65d2c1eb9"}
|
||||
{"OrderListHash", "380076bc7854977f46318e8add9f1a25"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "8220"},
|
||||
{"Total Orders", "8220"},
|
||||
{"Average Win", "0.00%"},
|
||||
{"Average Loss", "0.00%"},
|
||||
{"Compounding Annual Return", "-100.000%"},
|
||||
|
||||
@@ -50,30 +50,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public override Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "72"},
|
||||
{"Total Orders", "81"},
|
||||
{"Average Win", "0.00%"},
|
||||
{"Average Loss", "0.00%"},
|
||||
{"Compounding Annual Return", "-0.006%"},
|
||||
{"Drawdown", "0.000%"},
|
||||
{"Expectancy", "-0.486"},
|
||||
{"Net Profit", "0.000%"},
|
||||
{"Sharpe Ratio", "-1.628"},
|
||||
{"Sharpe Ratio", "-101.77"},
|
||||
{"Sortino Ratio", "-9053542.758"},
|
||||
{"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"},
|
||||
{"Portfolio Turnover", "0.00%"},
|
||||
{"OrderListHash", "0df3713aeb32e9c0738200f2a109e2f9"}
|
||||
{"OrderListHash", "5ae07f747205646e859ab43fb1828711"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,14 +97,15 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "1"},
|
||||
{"Total Orders", "1"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "-0.010%"},
|
||||
{"Drawdown", "0.000%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "-0.008%"},
|
||||
{"Sharpe Ratio", "-1.183"},
|
||||
{"Sharpe Ratio", "-497.389"},
|
||||
{"Sortino Ratio", "-73.22"},
|
||||
{"Probabilistic Sharpe Ratio", "0.001%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -120,7 +121,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Estimated Strategy Capacity", "₹61000000000.00"},
|
||||
{"Lowest Capacity Asset", "YESBANK UL"},
|
||||
{"Portfolio Turnover", "0.00%"},
|
||||
{"OrderListHash", "6cc69218edd7bd461678b9ee0c575db5"}
|
||||
{"OrderListHash", "0cfbdeedf1ba2a02af1b6b35dfe8aac3"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,14 +121,15 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "6"},
|
||||
{"Total Orders", "6"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0.00%"},
|
||||
{"Compounding Annual Return", "-0.386%"},
|
||||
{"Drawdown", "0.000%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "-0.004%"},
|
||||
{"Sharpe Ratio", "-23.595"},
|
||||
{"Sharpe Ratio", "-328.371"},
|
||||
{"Sortino Ratio", "-328.371"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -144,7 +145,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Estimated Strategy Capacity", "₹84000.00"},
|
||||
{"Lowest Capacity Asset", "JUNIORBEES UL"},
|
||||
{"Portfolio Turnover", "0.04%"},
|
||||
{"OrderListHash", "57558324bc9b67b36ae33c3e1c191740"}
|
||||
{"OrderListHash", "5823d79e97915654a8f68ae5fa600b5a"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "91"},
|
||||
{"Total Orders", "91"},
|
||||
{"Average Win", "0.09%"},
|
||||
{"Average Loss", "-0.01%"},
|
||||
{"Compounding Annual Return", "5.732%"},
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 475788;
|
||||
public long DataPoints => 471135;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -114,7 +114,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "3"},
|
||||
{"Total Orders", "3"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
@@ -122,6 +122,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -133,11 +134,11 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Information Ratio", "0"},
|
||||
{"Tracking Error", "0"},
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$75.00"},
|
||||
{"Total Fees", "$26.00"},
|
||||
{"Estimated Strategy Capacity", "$70000.00"},
|
||||
{"Lowest Capacity Asset", "GOOCV W78ZERHAOVVQ|GOOCV VP83T1ZUHROL"},
|
||||
{"Portfolio Turnover", "61.34%"},
|
||||
{"OrderListHash", "cee5cc2b0f80c308b496cac0b8668163"}
|
||||
{"Portfolio Turnover", "61.31%"},
|
||||
{"OrderListHash", "a36c60c5fb020121d6541683138d8f28"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 475777;
|
||||
public long DataPoints => 471124;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -124,7 +124,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "418"},
|
||||
{"Total Orders", "420"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
@@ -132,6 +132,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -143,11 +144,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"},
|
||||
{"Portfolio Turnover", "338.56%"},
|
||||
{"OrderListHash", "e0289a2989c91934656ff7e578f5e810"}
|
||||
{"Portfolio Turnover", "338.60%"},
|
||||
{"OrderListHash", "c9eb598f33939941206efc018eb6ee45"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 475777;
|
||||
public long DataPoints => 471124;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -121,7 +121,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "2"},
|
||||
{"Total Orders", "2"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
@@ -129,6 +129,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -144,7 +145,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Estimated Strategy Capacity", "$1300000.00"},
|
||||
{"Lowest Capacity Asset", "GOOCV 30AKMEIPOSS1Y|GOOCV VP83T1ZUHROL"},
|
||||
{"Portfolio Turnover", "10.71%"},
|
||||
{"OrderListHash", "838e313ba57850227ec810ed8fb85a23"}
|
||||
{"OrderListHash", "6b2f02d5cedb870e539a7bfb967c777f"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
144
Algorithm.CSharp/BasicTemplateOptionsConsolidationAlgorithm.cs
Normal file
144
Algorithm.CSharp/BasicTemplateOptionsConsolidationAlgorithm.cs
Normal file
@@ -0,0 +1,144 @@
|
||||
/*
|
||||
* 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;
|
||||
using QuantConnect.Data.Consolidators;
|
||||
using QuantConnect.Data.Market;
|
||||
using QuantConnect.Data.UniverseSelection;
|
||||
using QuantConnect.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace QuantConnect.Algorithm.CSharp
|
||||
{
|
||||
/// <summary>
|
||||
/// A demonstration of consolidating options data into larger bars for your algorithm.
|
||||
/// </summary>
|
||||
public class BasicTemplateOptionsConsolidationAlgorithm: QCAlgorithm, IRegressionAlgorithmDefinition
|
||||
{
|
||||
private Dictionary<Symbol, IDataConsolidator> _consolidators = new();
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
SetStartDate(2013, 10, 7);
|
||||
SetEndDate(2013, 10, 11);
|
||||
SetCash(1000000);
|
||||
|
||||
var option = AddOption("SPY");
|
||||
option.SetFilter(-2, 2, 0, 189);
|
||||
}
|
||||
|
||||
public void OnQuoteBarConsolidated(object sender, QuoteBar quoteBar)
|
||||
{
|
||||
Log($"OnQuoteBarConsolidated called on {Time}");
|
||||
Log(quoteBar.ToString());
|
||||
}
|
||||
|
||||
public void OnTradeBarConsolidated(object sender, TradeBar tradeBar)
|
||||
{
|
||||
Log($"OnTradeBarConsolidated called on {Time}");
|
||||
Log(tradeBar.ToString());
|
||||
}
|
||||
|
||||
public override void OnSecuritiesChanged(SecurityChanges changes)
|
||||
{
|
||||
foreach(var security in changes.AddedSecurities)
|
||||
{
|
||||
IDataConsolidator consolidator;
|
||||
if (security.Type == SecurityType.Equity)
|
||||
{
|
||||
consolidator = new TradeBarConsolidator(TimeSpan.FromMinutes(5));
|
||||
(consolidator as TradeBarConsolidator).DataConsolidated += OnTradeBarConsolidated;
|
||||
}
|
||||
else
|
||||
{
|
||||
consolidator = new QuoteBarConsolidator(new TimeSpan(0, 5, 0));
|
||||
(consolidator as QuoteBarConsolidator).DataConsolidated += OnQuoteBarConsolidated;
|
||||
}
|
||||
|
||||
SubscriptionManager.AddConsolidator(security.Symbol, consolidator);
|
||||
_consolidators[security.Symbol] = consolidator;
|
||||
}
|
||||
|
||||
foreach(var security in changes.RemovedSecurities)
|
||||
{
|
||||
_consolidators.Remove(security.Symbol, out var consolidator);
|
||||
SubscriptionManager.RemoveConsolidator(security.Symbol, consolidator);
|
||||
|
||||
if (security.Type == SecurityType.Equity)
|
||||
{
|
||||
(consolidator as TradeBarConsolidator).DataConsolidated -= OnTradeBarConsolidated;
|
||||
}
|
||||
else
|
||||
{
|
||||
(consolidator as QuoteBarConsolidator).DataConsolidated -= OnQuoteBarConsolidated;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <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 => 3943;
|
||||
|
||||
/// <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 Orders", "0"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
{"Drawdown", "0%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Sortino 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", "-8.91"},
|
||||
{"Tracking Error", "0.223"},
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", ""},
|
||||
{"Portfolio Turnover", "0%"},
|
||||
{"OrderListHash", "d41d8cd98f00b204e9800998ecf8427e"}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -134,14 +134,15 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "2"},
|
||||
{"Total Orders", "2"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "-1.31%"},
|
||||
{"Compounding Annual Return", "-15.304%"},
|
||||
{"Drawdown", "1.300%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "-1.311%"},
|
||||
{"Sharpe Ratio", "-3.31"},
|
||||
{"Sharpe Ratio", "-3.607"},
|
||||
{"Sortino Ratio", "-1.188"},
|
||||
{"Probabilistic Sharpe Ratio", "0.035%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -157,7 +158,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", "GOOCV W78ZFMML01JA|GOOCV VP83T1ZUHROL"},
|
||||
{"Portfolio Turnover", "0.05%"},
|
||||
{"OrderListHash", "0b52bbe98ade8e3aab943e64fcf4abfe"}
|
||||
{"OrderListHash", "3330cabe259c0abbc1010707554ae3d7"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 1253773;
|
||||
public long DataPoints => 1252633;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -112,7 +112,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "2"},
|
||||
{"Total Orders", "2"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "-0.40%"},
|
||||
{"Compounding Annual Return", "-21.622%"},
|
||||
@@ -120,6 +120,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "-0.311%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -135,7 +136,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", "GOOCV VP83T1ZUHROL"},
|
||||
{"Portfolio Turnover", "15.08%"},
|
||||
{"OrderListHash", "0f8537495f5744c02191656d6b3f9205"}
|
||||
{"OrderListHash", "8f60c485b60fe6a6dece59bc89e74997"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "4"},
|
||||
{"Total Orders", "4"},
|
||||
{"Average Win", "0.14%"},
|
||||
{"Average Loss", "-0.28%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
@@ -159,11 +159,12 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Expectancy", "0.502"},
|
||||
{"Net Profit", "-386.489%"},
|
||||
{"Sharpe Ratio", "-0.033"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "1.235%"},
|
||||
{"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"},
|
||||
@@ -174,7 +175,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", "AAPL R735QTJ8XC9X"},
|
||||
{"Portfolio Turnover", "13.46%"},
|
||||
{"OrderListHash", "83c9fb13ee32284702779eff8d11c608"}
|
||||
{"OrderListHash", "802ed167e77f73ae87ee12d0cf2c879c"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public long DataPoints => 32492;
|
||||
public long DataPoints => 32351;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -121,30 +121,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "4"},
|
||||
{"Total Orders", "5"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "-0.07%"},
|
||||
{"Compounding Annual Return", "-12.496%"},
|
||||
{"Drawdown", "0.200%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "-0.134%"},
|
||||
{"Sharpe Ratio", "-8.839"},
|
||||
{"Sharpe Ratio", "-9.78"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"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"},
|
||||
{"Portfolio Turnover", "2.28%"},
|
||||
{"OrderListHash", "81e8a822d43de2165c1d3f52964ec312"}
|
||||
{"OrderListHash", "3f6cce0fcc7b988ba378a357ede1af93"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public virtual long DataPoints => 65536;
|
||||
public virtual long DataPoints => 57794;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -117,30 +117,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "5"},
|
||||
{"Total Orders", "5"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "-0.69%"},
|
||||
{"Compounding Annual Return", "58.005%"},
|
||||
{"Drawdown", "0.400%"},
|
||||
{"Expectancy", "-0.5"},
|
||||
{"Net Profit", "0.588%"},
|
||||
{"Sharpe Ratio", "1.448"},
|
||||
{"Sharpe Ratio", "0.836"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "51.980%"},
|
||||
{"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", "$580000.00"},
|
||||
{"Lowest Capacity Asset", "SPXW 31K54PVWHUJHQ|SPX 31"},
|
||||
{"Portfolio Turnover", "0.48%"},
|
||||
{"OrderListHash", "174bd0a99916d58ca3f12139306940db"}
|
||||
{"OrderListHash", "f3f48428583b1f81646d830e1d8ddaa6"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
|
||||
// weekly option SPX contracts
|
||||
var spxw = AddIndexOption(spx, "SPXW");
|
||||
spxw.SetFilter(u => u.Strikes(0, 1)
|
||||
spxw.SetFilter(u => u.Strikes(-1, +1)
|
||||
// single week ahead since there are many SPXW contracts and we want to preserve performance
|
||||
.Expiration(0, 7)
|
||||
.IncludeWeeklys());
|
||||
@@ -66,7 +66,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
OptionChain chain;
|
||||
if (slice.OptionChains.TryGetValue(_spxOption, out chain))
|
||||
{
|
||||
// we find the first expiration group of call options and order them in ascending strike
|
||||
// we find the first expiration group of call options and order them in ascending strike
|
||||
var contracts = chain
|
||||
.Where(x => x.Right == OptionRight.Call)
|
||||
.OrderBy(x => x.Expiry)
|
||||
@@ -109,7 +109,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <summary>
|
||||
/// Data Points count of all timeslices of algorithm
|
||||
/// </summary>
|
||||
public virtual long DataPoints => 35451;
|
||||
public virtual long DataPoints => 40893;
|
||||
|
||||
/// <summary>
|
||||
/// Data Points count of the algorithm history
|
||||
@@ -121,30 +121,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public virtual Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "4"},
|
||||
{"Average Win", "0.12%"},
|
||||
{"Average Loss", "0.00%"},
|
||||
{"Compounding Annual Return", "8.975%"},
|
||||
{"Total Orders", "10"},
|
||||
{"Average Win", "0.47%"},
|
||||
{"Average Loss", "-0.01%"},
|
||||
{"Compounding Annual Return", "99.729%"},
|
||||
{"Drawdown", "0.100%"},
|
||||
{"Expectancy", "62.078"},
|
||||
{"Net Profit", "0.110%"},
|
||||
{"Sharpe Ratio", "-7.925"},
|
||||
{"Probabilistic Sharpe Ratio", "1.216%"},
|
||||
{"Expectancy", "24.484"},
|
||||
{"Net Profit", "0.890%"},
|
||||
{"Sharpe Ratio", "8.078"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "93.697%"},
|
||||
{"Loss Rate", "50%"},
|
||||
{"Win Rate", "50%"},
|
||||
{"Profit-Loss Ratio", "125.16"},
|
||||
{"Alpha", "-0.012"},
|
||||
{"Beta", "0.001"},
|
||||
{"Annual Standard Deviation", "0"},
|
||||
{"Profit-Loss Ratio", "49.97"},
|
||||
{"Alpha", "-1.975"},
|
||||
{"Beta", "0.301"},
|
||||
{"Annual Standard Deviation", "0.021"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-103.223"},
|
||||
{"Tracking Error", "0.069"},
|
||||
{"Treynor Ratio", "-2.449"},
|
||||
{"Information Ratio", "-143.477"},
|
||||
{"Tracking Error", "0.049"},
|
||||
{"Treynor Ratio", "0.566"},
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$1800000.00"},
|
||||
{"Estimated Strategy Capacity", "$13000000.00"},
|
||||
{"Lowest Capacity Asset", "SPXW XKX6S2GM9PGU|SPX 31"},
|
||||
{"Portfolio Turnover", "0.03%"},
|
||||
{"OrderListHash", "38db27781e4df93687d0895df9796c7d"}
|
||||
{"Portfolio Turnover", "0.28%"},
|
||||
{"OrderListHash", "8d50e6156e48b316007f3455d2bd0410"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
93
Algorithm.CSharp/BasicTemplateTradableIndexAlgorithm.cs
Normal file
93
Algorithm.CSharp/BasicTemplateTradableIndexAlgorithm.cs
Normal file
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* 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;
|
||||
using System.Collections.Generic;
|
||||
using QuantConnect.Orders;
|
||||
using System.Linq;
|
||||
|
||||
namespace QuantConnect.Algorithm.CSharp
|
||||
{
|
||||
/// <summary>
|
||||
/// This example demonstrates how to add index asset types and change the tradable condition
|
||||
/// </summary>
|
||||
/// <meta name="tag" content="using data" />
|
||||
/// <meta name="tag" content="benchmarks" />
|
||||
/// <meta name="tag" content="indexes" />
|
||||
public class BasicTemplateTradableIndexAlgorithm : BasicTemplateIndexAlgorithm
|
||||
{
|
||||
private OrderTicket _ticket;
|
||||
|
||||
/// <summary>
|
||||
/// Initialize your algorithm and add desired assets.
|
||||
/// </summary>
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
Securities[Spx].IsTradable = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Index EMA Cross trading underlying.
|
||||
/// </summary>
|
||||
public override void OnData(Slice slice)
|
||||
{
|
||||
base.OnData(slice);
|
||||
_ticket ??= MarketOrder(Spx, 1);
|
||||
}
|
||||
|
||||
public override void OnEndOfAlgorithm()
|
||||
{
|
||||
if (!_ticket.Status.IsFill())
|
||||
{
|
||||
throw new Exception("Index is tradable.");
|
||||
}
|
||||
}
|
||||
|
||||
/// <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()
|
||||
{
|
||||
{"Total Orders", "5"},
|
||||
{"Average Win", "6.15%"},
|
||||
{"Average Loss", "-0.01%"},
|
||||
{"Compounding Annual Return", "434.741%"},
|
||||
{"Drawdown", "3.400%"},
|
||||
{"Expectancy", "589.124"},
|
||||
{"Net Profit", "5.510%"},
|
||||
{"Sharpe Ratio", "-6.336"},
|
||||
{"Sortino Ratio", "-12.182"},
|
||||
{"Probabilistic Sharpe Ratio", "0.011%"},
|
||||
{"Loss Rate", "50%"},
|
||||
{"Win Rate", "50%"},
|
||||
{"Profit-Loss Ratio", "1179.25"},
|
||||
{"Alpha", "-0.226"},
|
||||
{"Beta", "0.02"},
|
||||
{"Annual Standard Deviation", "0.034"},
|
||||
{"Annual Variance", "0.001"},
|
||||
{"Information Ratio", "-7.032"},
|
||||
{"Tracking Error", "0.107"},
|
||||
{"Treynor Ratio", "-10.906"},
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$3000.00"},
|
||||
{"Lowest Capacity Asset", "SPX XL80P3GHDZXQ|SPX 31"},
|
||||
{"Portfolio Turnover", "24.13%"},
|
||||
{"OrderListHash", "41644492e032f38d0d9be0915f09a03b"}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public override Dictionary<string, string> ExpectedStatistics => new()
|
||||
{
|
||||
{"Total Trades", "49"},
|
||||
{"Total Orders", "49"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
@@ -61,6 +61,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -76,7 +77,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Estimated Strategy Capacity", "₮220000.00"},
|
||||
{"Lowest Capacity Asset", "BTCUSDT 18N"},
|
||||
{"Portfolio Turnover", "22.80%"},
|
||||
{"OrderListHash", "7417649395922ff3791471b4f3b5c021"}
|
||||
{"OrderListHash", "3981b9ec6c7940ae6b0e763212390cc6"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public override Dictionary<string, string> ExpectedStatistics => new()
|
||||
{
|
||||
{"Total Trades", "49"},
|
||||
{"Total Orders", "49"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
@@ -61,6 +61,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -76,7 +77,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Estimated Strategy Capacity", "₮12000000.00"},
|
||||
{"Lowest Capacity Asset", "BTCUSDT 18N"},
|
||||
{"Portfolio Turnover", "22.80%"},
|
||||
{"OrderListHash", "7417649395922ff3791471b4f3b5c021"}
|
||||
{"OrderListHash", "3981b9ec6c7940ae6b0e763212390cc6"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public override Dictionary<string, string> ExpectedStatistics => new()
|
||||
{
|
||||
{"Total Trades", "49"},
|
||||
{"Total Orders", "49"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
@@ -60,6 +60,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -75,7 +76,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Estimated Strategy Capacity", "$2000.00"},
|
||||
{"Lowest Capacity Asset", "BTCUSD E3"},
|
||||
{"Portfolio Turnover", "0.28%"},
|
||||
{"OrderListHash", "7f892f0c42d8826ff770ee602fe207a2"}
|
||||
{"OrderListHash", "3c23bc8622691cb9d4cacb00de5b0dd8"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public override Dictionary<string, string> ExpectedStatistics => new()
|
||||
{
|
||||
{"Total Trades", "49"},
|
||||
{"Total Orders", "49"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
@@ -60,6 +60,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -75,7 +76,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Estimated Strategy Capacity", "$640000.00"},
|
||||
{"Lowest Capacity Asset", "BTCUSD E3"},
|
||||
{"Portfolio Turnover", "0.28%"},
|
||||
{"OrderListHash", "7f892f0c42d8826ff770ee602fe207a2"}
|
||||
{"OrderListHash", "3c23bc8622691cb9d4cacb00de5b0dd8"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,30 +88,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "14"},
|
||||
{"Total Orders", "14"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "-0.23%"},
|
||||
{"Compounding Annual Return", "63.336%"},
|
||||
{"Drawdown", "1.100%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "0.674%"},
|
||||
{"Sharpe Ratio", "4.042"},
|
||||
{"Sharpe Ratio", "3.986"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "58.892%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "-0.592"},
|
||||
{"Alpha", "-0.595"},
|
||||
{"Beta", "0.57"},
|
||||
{"Annual Standard Deviation", "0.133"},
|
||||
{"Annual Variance", "0.018"},
|
||||
{"Information Ratio", "-13.918"},
|
||||
{"Tracking Error", "0.104"},
|
||||
{"Treynor Ratio", "0.943"},
|
||||
{"Treynor Ratio", "0.93"},
|
||||
{"Total Fees", "$40.20"},
|
||||
{"Estimated Strategy Capacity", "$4400000.00"},
|
||||
{"Lowest Capacity Asset", "AIG R735QTJ8XC9X"},
|
||||
{"Portfolio Turnover", "64.47%"},
|
||||
{"OrderListHash", "7e43a08e470a1709c7f7066d6ed1d445"}
|
||||
{"OrderListHash", "b1a3afb0457810d2b512ae48fe3f5a01"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
263
Algorithm.CSharp/BybitCryptoFuturesRegressionAlgorithm.cs
Normal file
263
Algorithm.CSharp/BybitCryptoFuturesRegressionAlgorithm.cs
Normal file
@@ -0,0 +1,263 @@
|
||||
/*
|
||||
* 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 Orders", "5"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
{"Drawdown", "0%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Sortino 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", "114cfc5cfe796850f7ac29c2e63407d6"}
|
||||
};
|
||||
}
|
||||
}
|
||||
172
Algorithm.CSharp/BybitCryptoRegressionAlgorithm.cs
Normal file
172
Algorithm.CSharp/BybitCryptoRegressionAlgorithm.cs
Normal file
@@ -0,0 +1,172 @@
|
||||
/*
|
||||
* 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 Orders", "3"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
{"Drawdown", "0%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Sortino 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", "b3a9eb7392ba1eb7eb0cc387f7382b6c"}
|
||||
};
|
||||
}
|
||||
}
|
||||
184
Algorithm.CSharp/BybitCustomDataCryptoRegressionAlgorithm.cs
Normal file
184
Algorithm.CSharp/BybitCustomDataCryptoRegressionAlgorithm.cs
Normal file
@@ -0,0 +1,184 @@
|
||||
/*
|
||||
* 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.Interfaces;
|
||||
using System.IO;
|
||||
using QuantConnect.Orders;
|
||||
|
||||
namespace QuantConnect.Algorithm.CSharp
|
||||
{
|
||||
/// <summary>
|
||||
/// Algorithm demonstrating and ensuring that Bybit crypto brokerage model works as expected with custom data types
|
||||
/// </summary>
|
||||
public class BybitCustomDataCryptoRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition
|
||||
{
|
||||
private Symbol _btcUsdt;
|
||||
|
||||
private ExponentialMovingAverage _fast;
|
||||
private ExponentialMovingAverage _slow;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
SetStartDate(2022, 12, 13);
|
||||
SetEndDate(2022, 12, 13);
|
||||
|
||||
SetAccountCurrency("USDT");
|
||||
SetCash(100000);
|
||||
|
||||
SetBrokerageModel(BrokerageName.Bybit, AccountType.Cash);
|
||||
|
||||
var symbol = AddCrypto("BTCUSDT").Symbol;
|
||||
_btcUsdt = AddData<CustomCryptoData>(symbol, Resolution.Minute).Symbol;
|
||||
|
||||
// create two moving averages
|
||||
_fast = EMA(_btcUsdt, 30, Resolution.Minute);
|
||||
_slow = EMA(_btcUsdt, 60, Resolution.Minute);
|
||||
}
|
||||
|
||||
public override void OnData(Slice data)
|
||||
{
|
||||
if (!_slow.IsReady)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_fast > _slow)
|
||||
{
|
||||
if (Transactions.OrdersCount == 0)
|
||||
{
|
||||
Buy(_btcUsdt, 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Transactions.OrdersCount == 1)
|
||||
{
|
||||
Liquidate(_btcUsdt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnOrderEvent(OrderEvent orderEvent)
|
||||
{
|
||||
Debug(Time + " " + orderEvent);
|
||||
}
|
||||
|
||||
public class CustomCryptoData : BaseData
|
||||
{
|
||||
public decimal Open;
|
||||
public decimal High;
|
||||
public decimal Low;
|
||||
public decimal Close;
|
||||
public decimal Volume;
|
||||
|
||||
public override DateTime EndTime
|
||||
{
|
||||
get { return Time + Period; }
|
||||
set { Time = value - Period; }
|
||||
}
|
||||
|
||||
public TimeSpan Period
|
||||
{
|
||||
get { return QuantConnect.Time.OneMinute; }
|
||||
}
|
||||
|
||||
public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)
|
||||
{
|
||||
var tickTypeString = config.TickType.TickTypeToLower();
|
||||
var formattedDate = date.ToStringInvariant(DateFormat.EightCharacter);
|
||||
var source = Path.Combine(Globals.DataFolder, "crypto", "bybit", config.Resolution.ToString().ToLower(),
|
||||
config.Symbol.Value.ToLower(), $"{formattedDate}_{tickTypeString}.zip");
|
||||
|
||||
return new SubscriptionDataSource(source, SubscriptionTransportMedium.LocalFile, FileFormat.Csv);
|
||||
}
|
||||
|
||||
public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)
|
||||
{
|
||||
var csv = line.ToCsv(6);
|
||||
|
||||
var data = new CustomCryptoData
|
||||
{
|
||||
Symbol = config.Symbol,
|
||||
Time = date.Date.AddMilliseconds(csv[0].ToInt32()).ConvertTo(config.DataTimeZone, config.ExchangeTimeZone),
|
||||
Open = csv[1].ToDecimal(),
|
||||
High = csv[2].ToDecimal(),
|
||||
Low = csv[3].ToDecimal(),
|
||||
Close = csv[4].ToDecimal(),
|
||||
Volume = csv[5].ToDecimal(),
|
||||
Value = csv[4].ToDecimal()
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
/// <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 => 4324;
|
||||
|
||||
/// <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 Orders", "2"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
{"Drawdown", "0%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Sortino 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", "BTCUSDT.CustomCryptoData 2US"},
|
||||
{"Portfolio Turnover", "34.30%"},
|
||||
{"OrderListHash", "6d099b57951f4801f9c07fba5f4c9f05"}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -137,7 +137,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "2"},
|
||||
{"Total Orders", "5"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
@@ -145,6 +145,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
@@ -158,9 +159,9 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$370000.00"},
|
||||
{"Lowest Capacity Asset", "ETHUSD XJ"},
|
||||
{"Lowest Capacity Asset", "ETHUSD 2XR"},
|
||||
{"Portfolio Turnover", "104.59%"},
|
||||
{"OrderListHash", "aea2e321d17414c1f3c6fa2491f10c88"}
|
||||
{"OrderListHash", "ec714d818fa30597e992d4c6e939e68c"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "70"},
|
||||
{"Total Orders", "70"},
|
||||
{"Average Win", "0.07%"},
|
||||
{"Average Loss", "-0.51%"},
|
||||
{"Compounding Annual Return", "-89.548%"},
|
||||
|
||||
@@ -111,7 +111,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "19"},
|
||||
{"Total Orders", "19"},
|
||||
{"Average Win", "39.16%"},
|
||||
{"Average Loss", "-8.81%"},
|
||||
{"Compounding Annual Return", "-99.857%"},
|
||||
|
||||
@@ -195,7 +195,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "1015"},
|
||||
{"Total Orders", "1015"},
|
||||
{"Average Win", "0.01%"},
|
||||
{"Average Loss", "0.00%"},
|
||||
{"Compounding Annual Return", "-12.674%"},
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "150"},
|
||||
{"Total Orders", "150"},
|
||||
{"Average Win", "0.16%"},
|
||||
{"Average Loss", "-0.11%"},
|
||||
{"Compounding Annual Return", "-19.320%"},
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "1005"},
|
||||
{"Total Orders", "1005"},
|
||||
{"Average Win", "0.96%"},
|
||||
{"Average Loss", "-0.33%"},
|
||||
{"Compounding Annual Return", "76.267%"},
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "671"},
|
||||
{"Total Orders", "671"},
|
||||
{"Average Win", "0.07%"},
|
||||
{"Average Loss", "-0.04%"},
|
||||
{"Compounding Annual Return", "-80.820%"},
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "1217"},
|
||||
{"Total Orders", "1217"},
|
||||
{"Average Win", "2.69%"},
|
||||
{"Average Loss", "-0.93%"},
|
||||
{"Compounding Annual Return", "-99.756%"},
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "735"},
|
||||
{"Total Orders", "735"},
|
||||
{"Average Win", "0.08%"},
|
||||
{"Average Loss", "-0.05%"},
|
||||
{"Compounding Annual Return", "-93.946%"},
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "603"},
|
||||
{"Total Orders", "603"},
|
||||
{"Average Win", "0.20%"},
|
||||
{"Average Loss", "-0.26%"},
|
||||
{"Compounding Annual Return", "-100.000%"},
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "35"},
|
||||
{"Total Orders", "35"},
|
||||
{"Average Win", "0.07%"},
|
||||
{"Average Loss", "-0.07%"},
|
||||
{"Compounding Annual Return", "-68.407%"},
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "35"},
|
||||
{"Total Orders", "35"},
|
||||
{"Average Win", "0.05%"},
|
||||
{"Average Loss", "-0.10%"},
|
||||
{"Compounding Annual Return", "-72.444%"},
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "162"},
|
||||
{"Total Orders", "162"},
|
||||
{"Average Win", "0.10%"},
|
||||
{"Average Loss", "-0.35%"},
|
||||
{"Compounding Annual Return", "-94.432%"},
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user