Compare commits
172 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a81414a94 | ||
|
|
3f85c9ab82 | ||
|
|
f062b54450 | ||
|
|
64b95b2e8e | ||
|
|
7bcaaf8f23 | ||
|
|
8383163aae | ||
|
|
04f3c850ba | ||
|
|
5bd0675423 | ||
|
|
6eb3822193 | ||
|
|
12b62f6ec9 | ||
|
|
8d2455b629 | ||
|
|
171f0f19d5 | ||
|
|
e5a50109b4 | ||
|
|
c8d13080a8 | ||
|
|
8d352b6318 | ||
|
|
00cd8947a8 | ||
|
|
c211d04798 | ||
|
|
55195867a9 | ||
|
|
c9a3ad35e1 | ||
|
|
0d45bf5101 | ||
|
|
66552b49bd | ||
|
|
0642f58bda | ||
|
|
c7e6c96933 | ||
|
|
5c10b2cb82 | ||
|
|
4dd2ad85a9 | ||
|
|
10defd4928 | ||
|
|
891aeb87d3 | ||
|
|
2fa07561b1 | ||
|
|
148b9c8d45 | ||
|
|
65cecef030 | ||
|
|
4fed304eb7 | ||
|
|
a987e0231f | ||
|
|
f47775338c | ||
|
|
fa1e97bc60 | ||
|
|
8fb649ceb4 | ||
|
|
7d8754f33c | ||
|
|
080511fa5a | ||
|
|
5146329c0f | ||
|
|
47fb4e64f2 | ||
|
|
5361f87dd1 | ||
|
|
72fb362f96 | ||
|
|
24e3a71581 | ||
|
|
15555f710d | ||
|
|
3d13fb6935 | ||
|
|
74f0c89499 | ||
|
|
0991f089d0 | ||
|
|
424fa36703 | ||
|
|
afbd058dad | ||
|
|
66d2f42d01 | ||
|
|
11f8dc2958 | ||
|
|
03f56481d4 | ||
|
|
c367451c6d | ||
|
|
c4e6e7f8dc | ||
|
|
ef5f7fbc50 | ||
|
|
7f9d35f666 | ||
|
|
be0fc9a879 | ||
|
|
a882aadeef | ||
|
|
02f7742878 | ||
|
|
b7c18cbfe7 | ||
|
|
6e6a1631dc | ||
|
|
250ffa1fec | ||
|
|
7e2678d0f6 | ||
|
|
9f15ca4c9c | ||
|
|
d23ac25b67 | ||
|
|
8f7f862563 | ||
|
|
0f0eeaff82 | ||
|
|
e8cf002238 | ||
|
|
e875b111d7 | ||
|
|
a231a7d47a | ||
|
|
37cce922d3 | ||
|
|
5f9e4a6bca | ||
|
|
42c58d6e53 | ||
|
|
ab6027723f | ||
|
|
37473c4580 | ||
|
|
677661766b | ||
|
|
c66a26e01d | ||
|
|
effa2da594 | ||
|
|
572aa99743 | ||
|
|
e77e202373 | ||
|
|
f9c50e28ef | ||
|
|
4c773c348c | ||
|
|
41f9d9da94 | ||
|
|
5f6a40fd9c | ||
|
|
0335b49edf | ||
|
|
1175c304e1 | ||
|
|
6c42f58b68 | ||
|
|
22a5378604 | ||
|
|
2df6715301 | ||
|
|
459f812223 | ||
|
|
22caf9ef2a | ||
|
|
94fb9293dc | ||
|
|
59266d84bf | ||
|
|
8ee9432bda | ||
|
|
99088d6dd8 | ||
|
|
15183cefe8 | ||
|
|
9e96aeb440 | ||
|
|
a2beeffcde | ||
|
|
c384fe0e2a | ||
|
|
ee6631dd8a | ||
|
|
4fdb748b42 | ||
|
|
ff0ecc7ed2 | ||
|
|
dcdfc7fdb3 | ||
|
|
a83eb7bf88 | ||
|
|
4e0ef94c97 | ||
|
|
c4db451416 | ||
|
|
112c14e0e8 | ||
|
|
87b16bc20c | ||
|
|
bb8bd27fe5 | ||
|
|
978da37cda | ||
|
|
4bb7fc17a2 | ||
|
|
d903ca60ef | ||
|
|
ec77cf3ca5 | ||
|
|
76600a3a0e | ||
|
|
dcb578cdfb | ||
|
|
838e94ec18 | ||
|
|
9887a05d77 | ||
|
|
cd0c447bcc | ||
|
|
d91ccac4aa | ||
|
|
9d93dc1570 | ||
|
|
5bf72d2432 | ||
|
|
d24edf5a6c | ||
|
|
a0c2e38eae | ||
|
|
fe2ac131af | ||
|
|
b8e3294a5f | ||
|
|
25f4cdd92f | ||
|
|
82c9b6ccb7 | ||
|
|
9c1722d0b9 | ||
|
|
a475178dbb | ||
|
|
e6ffb1ac62 | ||
|
|
70996b0507 | ||
|
|
58793acae8 | ||
|
|
6af3f70fed | ||
|
|
373c41e568 | ||
|
|
96f42eb591 | ||
|
|
62c51ab17c | ||
|
|
bbcb81804c | ||
|
|
6dfe492212 | ||
|
|
d76bfaade4 | ||
|
|
ed077da501 | ||
|
|
1958ac2935 | ||
|
|
2847d9e27d | ||
|
|
cf7a26b8b6 | ||
|
|
f3c386663b | ||
|
|
865da14540 | ||
|
|
019ac01a4c | ||
|
|
4a8bcb82db | ||
|
|
7ddee34e86 | ||
|
|
f00d4655cf | ||
|
|
83431c956c | ||
|
|
772eb4650c | ||
|
|
a7e5acd8d3 | ||
|
|
83f9499b4a | ||
|
|
a3836a64c4 | ||
|
|
db61cea3db | ||
|
|
fd4e1dc0a0 | ||
|
|
bb9cde1cee | ||
|
|
c082f0dda3 | ||
|
|
845e874132 | ||
|
|
706091b25e | ||
|
|
fe040a55e9 | ||
|
|
ab82e75885 | ||
|
|
ba4e2b115c | ||
|
|
2b0fd2e607 | ||
|
|
5b10b3b509 | ||
|
|
a7b2d9450f | ||
|
|
6af20c3d8a | ||
|
|
cb9bc95c37 | ||
|
|
72b6a22230 | ||
|
|
6fbc3786b0 | ||
|
|
ea11fb41c9 | ||
|
|
f5b729dc0d | ||
|
|
9ba15b23e3 |
13
.editorconfig
Normal file
13
.editorconfig
Normal file
@@ -0,0 +1,13 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
|
||||
[*.{js,yml,json,config,csproj}]
|
||||
indent_size = 2
|
||||
|
||||
[*.sh]
|
||||
end_of_line = lf
|
||||
17
.github/workflows/gh-actions.yml
vendored
17
.github/workflows/gh-actions.yml
vendored
@@ -3,29 +3,28 @@ name: Build & Test Lean
|
||||
on:
|
||||
push:
|
||||
branches: ['*']
|
||||
tags: ['*']
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-16.04
|
||||
runs-on: ubuntu-20.04
|
||||
container:
|
||||
image: quantconnect/lean:foundation
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Restore nuget dependencies
|
||||
run: |
|
||||
nuget restore QuantConnect.Lean.sln -v quiet
|
||||
nuget install NUnit.Runners -Version 3.11.1 -OutputDirectory testrunner
|
||||
|
||||
- name: Build
|
||||
run: msbuild /p:Configuration=Release /p:VbcToolExe=vbnc.exe /v:quiet /p:WarningLevel=1 QuantConnect.Lean.sln
|
||||
run: dotnet build /p:Configuration=Release /v:quiet /p:WarningLevel=1 QuantConnect.Lean.sln
|
||||
|
||||
- name: Run Tests
|
||||
run: mono ./testrunner/NUnit.ConsoleRunner.3.11.1/tools/nunit3-console.exe ./Tests/bin/Release/QuantConnect.Tests.dll --where "cat != TravisExclude" --labels=Off --params:log-handler=ConsoleErrorLogHandler
|
||||
run: dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter TestCategory!=TravisExclude -- TestRunParameters.Parameter\(name=\"log-handler\", value=\"ConsoleErrorLogHandler\"\)
|
||||
|
||||
- name: Generate & Publish python stubs
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
run: |
|
||||
chmod +x ci_build_stubs.sh
|
||||
./ci_build_stubs.sh -d -t -g #Ignore Publish as of since credentials are missing on CI
|
||||
./ci_build_stubs.sh -t -g -p
|
||||
env:
|
||||
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
|
||||
|
||||
22
.github/workflows/regression-tests.yml
vendored
Normal file
22
.github/workflows/regression-tests.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
name: Regression Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ['*']
|
||||
tags: ['*']
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-20.04
|
||||
container:
|
||||
image: quantconnect/lean:foundation
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Build
|
||||
run: dotnet build /p:Configuration=Release /v:quiet /p:WarningLevel=1 QuantConnect.Lean.sln
|
||||
|
||||
- name: Run Tests
|
||||
run: dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter TestCategory=RegressionTests -- TestRunParameters.Parameter\(name=\"log-handler\", value=\"ConsoleErrorLogHandler\"\) TestRunParameters.Parameter\(name=\"reduced-disk-size\", value=\"true\"\)
|
||||
144
.idea/readme.md
generated
144
.idea/readme.md
generated
@@ -1,144 +0,0 @@
|
||||
<h1>Local Development & Docker Integration with Pycharm</h1>
|
||||
|
||||
This document contains information regarding ways to use Lean’s Docker image in conjunction with local development in Pycharm.
|
||||
|
||||
|
||||
<br />
|
||||
|
||||
<h1>Getting Setup</h1>
|
||||
|
||||
|
||||
Before anything we need to ensure a few things have been done:
|
||||
|
||||
|
||||
1. Get [Pycharm Professional](https://www.jetbrains.com/pycharm/)**
|
||||
|
||||
2. Get [Docker](https://docs.docker.com/get-docker/):
|
||||
* Follow the instructions for your Operating System
|
||||
* New to Docker? Try docker getting-started
|
||||
|
||||
|
||||
3. Pull Lean’s latest image from a terminal
|
||||
* _docker pull quantconnect/lean_
|
||||
|
||||
4. Get Lean into Pycharm
|
||||
* Download the repo or clone it using: _git clone[ https://github.com/QuantConnect/Lean](https://github.com/QuantConnect/Lean)_
|
||||
* Open the folder using Pycharm
|
||||
|
||||
|
||||
_**PyCharm’s remote debugger requires PyCharm Professional._
|
||||
|
||||
<br />
|
||||
|
||||
<h1>Develop Algorithms Locally, Run in Container</h1>
|
||||
|
||||
|
||||
We have set up a relatively easy way to develop algorithms in your local IDE and push them into the container to be run and debugged.
|
||||
|
||||
Before we can use this method with Windows or Mac OS we need to share the Lean directory with Docker.
|
||||
|
||||
<br />
|
||||
|
||||
<h2>Activate File Sharing for Docker:</h2>
|
||||
|
||||
* Windows:
|
||||
* [Guide to sharing](https://docs.docker.com/docker-for-windows/#file-sharing)
|
||||
* Share the LEAN root directory with docker
|
||||
|
||||
* Mac:
|
||||
* [Guide to sharing](https://docs.docker.com/docker-for-mac/#file-sharing)
|
||||
* Share the LEAN root directory with docker
|
||||
|
||||
* Linux:
|
||||
* (No setup required)
|
||||
|
||||
<br />
|
||||
|
||||
<h2>Lean Configuration</h2>
|
||||
|
||||
Next we need to be sure that our Lean configuration at **.\Launcher\config.json** is properly set. Just like running lean locally the config must reflect what we want Lean to run.
|
||||
|
||||
You configuration file should look something like this:
|
||||
|
||||
<h3>Python:</h3>
|
||||
|
||||
"algorithm-type-name": "**AlgorithmName**",
|
||||
|
||||
"algorithm-language": "Python",
|
||||
|
||||
"algorithm-location": "../../../Algorithm.Python/**AlgorithmName**.py",
|
||||
|
||||
<h4>Note About Python Algorithm Location</h4>
|
||||
|
||||
|
||||
Our specific configuration binds the Algorithm.Python directory to the container by default so any algorithm you would like to run should be in that directory. Please ensure your algorithm location looks just the same as the example above. If you want to use a different location refer to the section bellow on setting that argument for the container and make sure your config.json also reflects this.
|
||||
|
||||
|
||||
<br />
|
||||
|
||||
<h2>Running Lean in the Container</h2>
|
||||
|
||||
This section will cover how to actually launch Lean in the container with your desired configuration.
|
||||
|
||||
From a terminal; Pycharm has a built in terminal on the bottom taskbar labeled **Terminal**; launch the run_docker.bat/.sh script; there are a few choices on how to launch this:
|
||||
1. Launch with no parameters and answer the questions regarding configuration (Press enter for defaults)
|
||||
|
||||
* Enter docker image [default: quantconnect/lean:latest]:
|
||||
* Enter absolute path to Lean config file [default: _~currentDir_\Launcher\config.json]:
|
||||
* Enter absolute path to Data folder [default: ~_currentDir_\Data\]:
|
||||
* Enter absolute path to store results [default: ~_currentDir_\]:
|
||||
* Would you like to debug C#? (Requires mono debugger attachment) [default: N]:
|
||||
|
||||
2. Using the **run_docker.cfg** to store args for repeated use; any blank entries will resort to default values! example: **_./run_docker.bat run_docker.cfg_**
|
||||
|
||||
IMAGE=quantconnect/lean:latest
|
||||
CONFIG_FILE=
|
||||
DATA_DIR=
|
||||
RESULTS_DIR=
|
||||
DEBUGGING=
|
||||
PYTHON_DIR=
|
||||
|
||||
3. Inline arguments; anything you don't enter will use the default args! example: **_./run_docker.bat DEBUGGING=y_**
|
||||
* Accepted args for inline include all listed in the file in #2; must follow the **key=value** format
|
||||
|
||||
<br />
|
||||
|
||||
<h1>Debugging Python</h1>
|
||||
|
||||
Debugging your Python algorithms requires an extra step within your configuration and inside of PyCharm. Thankfully we were able to configure the PyCharm launch configurations to take care of most of the work for you!
|
||||
|
||||
<br />
|
||||
|
||||
<h2>Modifying the Configuration</h2>
|
||||
|
||||
First in order to debug a Python algorithm in Pycharm we must make the following change to our configuration (Launcher\config.json) under the comment debugging configuration:
|
||||
|
||||
"debugging": true,
|
||||
"debugging-method": "PyCharm",
|
||||
|
||||
|
||||
In setting this we are telling Lean to reach out and create a debugger connection using PyCharm’s PyDevd debugger server. Once this is set Lean will **always** attempt to connect to a debugger server on launch. **If you are no longer debugging set “debugging” to false.**
|
||||
|
||||
<br />
|
||||
|
||||
<h2>Using PyCharm Launch Options</h2>
|
||||
|
||||
|
||||
Now that Lean is configured for the debugger we can make use of the programmed launch options to connect.
|
||||
|
||||
|
||||
|
||||
**<h3>Container (Recommended)</h3>**
|
||||
|
||||
|
||||
To debug inside of the container we must first start the debugger server in Pycharm, to do this use the drop down configuration “Debug in Container” and launch the debugger. Be sure to set some breakpoints in your algorithms!
|
||||
|
||||
Then we will need to launch the container, follow the steps described in the section “[Running Lean in the Container](#Running-Lean-in-the-Container)”. After launching the container the debugging configuration will take effect and it will connect to the debug server where you can begin debugging your algorithm.
|
||||
|
||||
|
||||
**<h3>Local</h3>**
|
||||
|
||||
|
||||
To debug locally we must run the program locally. First, just as the container setup, start the PyCharm debugger server by running the “Debug Local” configuration.
|
||||
|
||||
Then start the program locally by whatever means you typically use, such as Mono, directly running the program at **QuantConnect.Lean.Launcher.exe**, etc. Once the program is running it will make the connection to your PyCharm debugger server where you can begin debugging your algorithm.
|
||||
37
.idea/workspace.xml
generated
37
.idea/workspace.xml
generated
@@ -1,37 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RunManager" selected="Python Debug Server.Debug in Container">
|
||||
<configuration name="Debug Local" type="PyRemoteDebugConfigurationType" factoryName="Python Remote Debug">
|
||||
<module name="LEAN" />
|
||||
<option name="PORT" value="6000" />
|
||||
<option name="HOST" value="localhost" />
|
||||
<PathMappingSettings>
|
||||
<option name="pathMappings">
|
||||
<list />
|
||||
</option>
|
||||
</PathMappingSettings>
|
||||
<option name="REDIRECT_OUTPUT" value="true" />
|
||||
<option name="SUSPEND_AFTER_CONNECT" value="true" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration name="Debug in Container" type="PyRemoteDebugConfigurationType" factoryName="Python Remote Debug">
|
||||
<module name="LEAN" />
|
||||
<option name="PORT" value="6000" />
|
||||
<option name="HOST" value="localhost" />
|
||||
<PathMappingSettings>
|
||||
<option name="pathMappings">
|
||||
<list>
|
||||
<mapping local-root="$PROJECT_DIR$" remote-root="/Lean" />
|
||||
</list>
|
||||
</option>
|
||||
</PathMappingSettings>
|
||||
<option name="REDIRECT_OUTPUT" value="true" />
|
||||
<option name="SUSPEND_AFTER_CONNECT" value="true" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<list>
|
||||
<item itemvalue="Python Debug Server.Debug Local" />
|
||||
<item itemvalue="Python Debug Server.Debug in Container" />
|
||||
</list>
|
||||
</component>
|
||||
</project>
|
||||
15
.travis.yml
15
.travis.yml
@@ -1,9 +1,8 @@
|
||||
sudo: required
|
||||
language: csharp
|
||||
mono: none
|
||||
dotnet: 5.0
|
||||
mono:
|
||||
- 5.12.0
|
||||
solution: QuantConnect.Lean.sln
|
||||
os: linux
|
||||
dist: focal
|
||||
before_install:
|
||||
- export PATH="$HOME/miniconda3/bin:$PATH"
|
||||
- export PYTHONNET_PYDLL="$HOME/miniconda3/lib/libpython3.6m.so"
|
||||
@@ -18,11 +17,7 @@ before_install:
|
||||
- conda install -y cython=0.29.15
|
||||
- conda install -y scipy=1.4.1
|
||||
- conda install -y wrapt=1.12.1
|
||||
install:
|
||||
- nuget install NUnit.Runners -Version 3.11.1 -OutputDirectory testrunner
|
||||
script:
|
||||
- dotnet nuget add source $TRAVIS_BUILD_DIR/LocalPackages
|
||||
- dotnet build /p:Configuration=Release /p:VbcToolExe=vbnc.exe /v:quiet /p:WarningLevel=1 QuantConnect.Lean.sln
|
||||
- mono ./testrunner/NUnit.ConsoleRunner.3.11.1/tools/nunit3-console.exe ./Tests/bin/Release/QuantConnect.Tests.dll --where "cat != TravisExclude" --labels=Off --params:log-handler=ConsoleErrorLogHandler
|
||||
- chmod +x ci_build_stubs.sh
|
||||
- sudo -E ./ci_build_stubs.sh -d -t -g -p
|
||||
- dotnet build /p:Configuration=Release /v:quiet /p:WarningLevel=1 QuantConnect.Lean.sln
|
||||
- dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter TestCategory!=TravisExclude -- TestRunParameters.Parameter\(name=\"log-handler\", value=\"ConsoleErrorLogHandler\"\)
|
||||
117
.vs/readme.md
117
.vs/readme.md
@@ -1,64 +1,49 @@
|
||||
<h1>Local Development & Docker Integration with Visual Studio</h1>
|
||||
<h1>Local Development with Visual Studio</h1>
|
||||
|
||||
This document contains information regarding ways to use Visual Studio to work with the Lean engine, this includes a couple options that make lean easy to develop on any machine:
|
||||
|
||||
This document contains information regarding ways to use Visual Studio to work with the Lean's Docker image.
|
||||
- Using Lean CLI -> A great tool for working with your algorithms locally, while still being able to deploy to the cloud and have access to Lean data. It is also able to run algorithms locally through our official docker images **Recommended for algorithm development.
|
||||
|
||||
- Locally installing all dependencies to run Lean with Visual Studio on your OS.
|
||||
|
||||
<br />
|
||||
|
||||
<h1>Getting Setup</h1>
|
||||
<h1>Setup</h1>
|
||||
|
||||
<h2>Option 1: Lean CLI</h2>
|
||||
|
||||
Before anything we need to ensure a few things have been done:
|
||||
|
||||
|
||||
1. Get [Visual Studio](https://code.visualstudio.com/download)
|
||||
* Get the Extension [VSMonoDebugger](https://marketplace.visualstudio.com/items?itemName=GordianDotNet.VSMonoDebugger0d62) for C# Debugging
|
||||
|
||||
2. Get [Docker](https://docs.docker.com/get-docker/):
|
||||
* Follow the instructions for your Operating System
|
||||
* New to Docker? Try docker getting-started
|
||||
|
||||
|
||||
3. Pull Lean’s latest image from a terminal
|
||||
* _docker pull quantconnect/lean_
|
||||
|
||||
4. Get Lean into Visual Studio
|
||||
* Download the repo or clone it using: _git clone[ https://github.com/QuantConnect/Lean](https://github.com/QuantConnect/Lean)_
|
||||
* Open the solution **QuantConnect.Lean.sln** using Visual Studio
|
||||
|
||||
To use Lean CLI follow the instructions for installation and tutorial for usage in our [documentation](https://www.quantconnect.com/docs/v2/lean-cli/getting-started/lean-cli).
|
||||
|
||||
<br />
|
||||
|
||||
<h1>Develop Algorithms Locally, Run in Container</h1>
|
||||
<h2>Option 2: Install Locally</h2>
|
||||
|
||||
1. Install [.Net 5](https://dotnet.microsoft.com/download) for the project
|
||||
|
||||
We have set up a relatively easy way to develop algorithms in your local IDE and push them into the container to be run and debugged.
|
||||
2. (Optional) Get [Python 3.6.8](https://www.python.org/downloads/release/python-368/) for running Python algorithms
|
||||
- Follow Python instructions [here](https://github.com/QuantConnect/Lean/tree/master/Algorithm.Python#installing-python-36) for your platform
|
||||
|
||||
Before we can use this method with Windows or Mac OS we need to share the Lean directory with Docker.
|
||||
3. Get [Visual Studio](https://visualstudio.microsoft.com/vs/)
|
||||
|
||||
4. Get Lean into VS
|
||||
- Download the repo or clone it using: _git clone [https://github.com/QuantConnect/Lean](https://github.com/QuantConnect/Lean)_
|
||||
- Open the project file with VS (QuantConnect.Lean.sln)
|
||||
|
||||
Your environment is prepared and ready to run lean
|
||||
|
||||
<br />
|
||||
|
||||
<h2>Activate File Sharing for Docker:</h2>
|
||||
<h1>How to use Lean</h1>
|
||||
|
||||
* Windows:
|
||||
* [Guide to sharing](https://docs.docker.com/docker-for-windows/#file-sharing)
|
||||
* Share the LEAN root directory with docker
|
||||
|
||||
* Mac:
|
||||
* [Guide to sharing](https://docs.docker.com/docker-for-mac/#file-sharing)
|
||||
* Share the LEAN root directory with docker
|
||||
|
||||
* Linux:
|
||||
* (No setup required)
|
||||
This section will cover configuring, launching and debugging lean. This is only applicable to option 2 from above. This does not apply to Lean CLI, please refer to [CLI documentation](https://www.quantconnect.com/docs/v2/lean-cli/getting-started/lean-cli)
|
||||
|
||||
<br />
|
||||
|
||||
<h2>Lean Configuration</h2>
|
||||
<h2>Configuration</h2>
|
||||
|
||||
Next we need to be sure that our Lean configuration at **.\Launcher\config.json** is properly set. Just like running lean locally the config must reflect what we want Lean to run.
|
||||
We need to be sure that our Lean configuration at **.\Launcher\config.json** is properly set.
|
||||
|
||||
You configuration file should look something like this for the following languages:
|
||||
Your configuration file should look something like this for the following languages:
|
||||
|
||||
<h3>Python:</h3>
|
||||
|
||||
@@ -78,59 +63,11 @@ You configuration file should look something like this for the following languag
|
||||
|
||||
<br />
|
||||
|
||||
<h2>Important Note About C#</h2>
|
||||
<h2>Launching Lean</h2>
|
||||
|
||||
In order to use a custom C# algorithm, the C# file must be compiled before running in the docker, as it is compiled into the file **"QuantConnect.Algorithm.CSharp.dll"**. Any new C# files will need to be added to the csproj compile list before it will compile, check **Algorithm.CSharp/QuantConnect.Algorithm.CSharp.csproj** for all algorithms that are compiled. Once there is an entry for your algorithm the project can be compiled by using **Build > Build Solution**.
|
||||
|
||||
If you would like to debug this file in the docker container one small change to the solutions target build is required.
|
||||
1. Right click on the solution **QuantConnect.Lean** in the _Solution Explorer_
|
||||
2. Select **Properties**
|
||||
3. For project entry **QuantConnect.Algorithm.CSharp** change the configuration to **DebugDocker**
|
||||
4. Select **Apply** and close out of the window.
|
||||
5. Build the project at least once before running the docker.
|
||||
Now that lean is configured we can launch. Use Visual Studio's run option, Make sure QuantConnect.Lean.Launcher is selected as the launch project. Any breakpoints in Lean C# will be triggered.
|
||||
|
||||
<br />
|
||||
|
||||
<h2>Running Lean in the Container</h2>
|
||||
|
||||
This section will cover how to actually launch Lean in the container with your desired configuration.
|
||||
|
||||
From a terminal launch the run_docker.bat/.sh script; there are a few choices on how to launch this:
|
||||
1. Launch with no parameters and answer the questions regarding configuration (Press enter for defaults)
|
||||
|
||||
* Enter docker image [default: quantconnect/lean:latest]:
|
||||
* Enter absolute path to Lean config file [default: _~currentDir_\Launcher\config.json]:
|
||||
* Enter absolute path to Data folder [default: ~_currentDir_\Data\]:
|
||||
* Enter absolute path to store results [default: ~_currentDir_\]:
|
||||
* Would you like to debug C#? (Requires mono debugger attachment) [default: N]:
|
||||
|
||||
2. Using the **run_docker.cfg** to store args for repeated use; any blank entries will resort to default values! example: **_./run_docker.bat run_docker.cfg_**
|
||||
|
||||
IMAGE=quantconnect/lean:latest
|
||||
CONFIG_FILE=
|
||||
DATA_DIR=
|
||||
RESULTS_DIR=
|
||||
DEBUGGING=
|
||||
PYTHON_DIR=
|
||||
|
||||
3. Inline arguments; anything you don't enter will use the default args! example: **_./run_docker.bat DEBUGGING=y_**
|
||||
* Accepted args for inline include all listed in the file in #2
|
||||
|
||||
<br />
|
||||
|
||||
<h1>Connecting to Mono Debugger</h1>
|
||||
|
||||
If you launch the script with debugging set to **yes** (y), then you will need to connect to the debugging server with the mono extension that you installed in the setup stage.
|
||||
|
||||
To setup the extension do the following:
|
||||
* Go to **Extensions > Mono > Settings...**
|
||||
* Enter the following for the settings:
|
||||
* Remote Host IP: 127.0.0.1
|
||||
* Remote Host Port: 55555
|
||||
* Mono Debug Port: 55555
|
||||
* Click **Save** and then close the extension settings
|
||||
|
||||
Now that the extension is setup use it to connect to the Docker container by using:
|
||||
* **Extensions > Mono > Attach to mono debugger**
|
||||
|
||||
The program should then launch and trigger any breakpoints you have set in your C# Algorithm.
|
||||
<h1>Common Issues</h1>
|
||||
Here we will cover some common issues with setting this up. Feel free to contribute to this section!
|
||||
|
||||
73
.vscode/launch.json
vendored
73
.vscode/launch.json
vendored
@@ -2,74 +2,39 @@
|
||||
/*
|
||||
VS Code Launch configurations for the LEAN engine
|
||||
|
||||
Launch w/ Mono (Local):
|
||||
Builds the project with MSBuild and then launches the program using mono locally;
|
||||
supports debugging. In order to use this you need msbuild and mono on your system path.
|
||||
As well as the Mono Debug extension from the marketplace.
|
||||
|
||||
Debug in Container:
|
||||
Launches our run_docker script to start the container and attaches to the debugger.
|
||||
Requires that you have built the project at least once as it will transfer the compiled
|
||||
csharp files.
|
||||
Requires Mono Debug extension from the marketplace.
|
||||
Launch:
|
||||
Builds the project with dotnet 5 and then launches the program using coreclr; supports debugging.
|
||||
In order to use this you need dotnet 5 on your system path, As well as the C# extension from the
|
||||
marketplace.
|
||||
|
||||
Attach to Python (Container):
|
||||
Will attempt to attach to LEAN in the container using PTVSD. Requires that the container is
|
||||
actively running and config is set: "debugging": true, "debugging-method": "PTVSD",
|
||||
Requires Python extension from the marketplace.
|
||||
|
||||
Attach to Python (Local):
|
||||
Attach to Python:
|
||||
Will attempt to attach to LEAN running locally using PTVSD. Requires that the process is
|
||||
actively running and config is set: "debugging": true, "debugging-method": "PTVSD",
|
||||
Requires Python extension from the marketplace.
|
||||
|
||||
Requires Python extension from the marketplace. Currently only works with algorithms in
|
||||
Algorithm.Python directory. This is because we map that directory to our build directory
|
||||
that contains the py file at runtime. If using another location change "localRoot" value
|
||||
to the directory in use.
|
||||
*/
|
||||
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Launch w/ Mono (Local)",
|
||||
"type": "mono",
|
||||
"name": "Launch",
|
||||
"type": "coreclr",
|
||||
"request": "launch",
|
||||
"preLaunchTask": "build",
|
||||
"cwd": "${workspaceFolder}/Launcher/bin/Debug/",
|
||||
"program": "${workspaceFolder}/Launcher/bin/Debug/QuantConnect.Lean.Launcher.exe",
|
||||
"program": "${workspaceFolder}/Launcher/bin/Debug/QuantConnect.Lean.Launcher.dll",
|
||||
"args": [
|
||||
"--data-folder",
|
||||
"${workspaceFolder}/Data",
|
||||
"--config",
|
||||
"${workspaceFolder}/Launcher/config.json"],
|
||||
"console": "externalTerminal"
|
||||
"${workspaceFolder}/Launcher/config.json"
|
||||
],
|
||||
"cwd": "${workspaceFolder}/Launcher/bin/Debug/",
|
||||
"stopAtEntry": false,
|
||||
"console": "integratedTerminal",
|
||||
"internalConsoleOptions": "neverOpen"
|
||||
},
|
||||
{
|
||||
"name": "Debug in Container",
|
||||
"type": "mono",
|
||||
"preLaunchTask": "run-docker",
|
||||
"postDebugTask": "close-docker",
|
||||
"request": "attach",
|
||||
"address": "localhost",
|
||||
"port": 55555
|
||||
},
|
||||
{
|
||||
"name": "Attach to Mono",
|
||||
"type": "mono",
|
||||
"request": "attach",
|
||||
"address": "localhost",
|
||||
"postDebugTask": "close-docker",
|
||||
"port": 55555
|
||||
},
|
||||
{
|
||||
"name": "Attach to Python (Container)",
|
||||
"type": "python",
|
||||
"request": "attach",
|
||||
"port": 5678,
|
||||
"pathMappings":[{
|
||||
"localRoot": "${workspaceFolder}",
|
||||
"remoteRoot": "/Lean/"
|
||||
}]
|
||||
},
|
||||
{
|
||||
"name": "Attach to Python (Local)",
|
||||
"name": "Attach to Python",
|
||||
"type": "python",
|
||||
"request": "attach",
|
||||
"port": 5678,
|
||||
|
||||
173
.vscode/readme.md
vendored
173
.vscode/readme.md
vendored
@@ -1,71 +1,49 @@
|
||||
<h1>Local Development & Docker Integration with Visual Studio Code</h1>
|
||||
|
||||
This document contains information regarding ways to use Visual Studio Code to work with the Lean engine, this includes a couple options that make lean easy to develop on any machine:
|
||||
|
||||
This document contains information regarding ways to use Visual Studio Code to work with the Lean engine, this includes using Lean’s Docker image in conjunction with local development as well as running Lean locally.
|
||||
- Using Lean CLI -> A great tool for working with your algorithms locally, while still being able to deploy to the cloud and have access to Lean data. It is also able to run algorithms locally through our official docker images **Recommended for algorithm development.
|
||||
|
||||
- Locally installing all dependencies to run Lean with Visual Studio Code on your OS.
|
||||
|
||||
<br />
|
||||
|
||||
<h1>Getting Setup</h1>
|
||||
<h1>Setup</h1>
|
||||
|
||||
<h2>Option 1: Lean CLI</h2>
|
||||
|
||||
Before anything we need to ensure a few things have been done:
|
||||
|
||||
|
||||
1. Get [Visual Studio Code](https://code.visualstudio.com/download)
|
||||
* Get the Extension [Mono Debug **15.8**](https://marketplace.visualstudio.com/items?itemName=ms-vscode.mono-debug) for C# Debugging
|
||||
* Get the Extension [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python) for Python Debugging
|
||||
|
||||
2. Get [Docker](https://docs.docker.com/get-docker/):
|
||||
* Follow the instructions for your Operating System
|
||||
* New to Docker? Try docker getting-started
|
||||
|
||||
3. Install a compiler for the project **(Only needed for C# Debugging or Running Locally)**
|
||||
* On Linux or Mac:
|
||||
* Install [mono-complete](https://www.mono-project.com/docs/getting-started/install/linux/)
|
||||
* Test msbuild with command: _msbuild -version_
|
||||
* On Windows:
|
||||
* Visual Studio comes packed with msbuild or download without VS [here](https://visualstudio.microsoft.com/downloads/?q=build+tools)
|
||||
* Put msbuild on your system path and test with command: _msbuild -version_
|
||||
|
||||
4. Pull Lean’s latest image from a terminal
|
||||
* _docker pull quantconnect/lean_
|
||||
|
||||
5. Get Lean into VS Code
|
||||
* Download the repo or clone it using: _git clone[ https://github.com/QuantConnect/Lean](https://github.com/QuantConnect/Lean)_
|
||||
* Open the folder using VS Code
|
||||
|
||||
**NOTES**:
|
||||
- Mono Extension Version 16 and greater fails to debug the docker container remotely, please install **Version 15.8**. To install an older version from within VS Code go to the extensions tab, search "Mono Debug", and select "Install Another Version...".
|
||||
<br />
|
||||
|
||||
<h1>Develop Algorithms Locally, Run in Container</h1>
|
||||
|
||||
|
||||
We have set up a relatively easy way to develop algorithms in your local IDE and push them into the container to be run and debugged.
|
||||
|
||||
Before we can use this method with Windows or Mac OS we need to share the Lean directory with Docker.
|
||||
To use Lean CLI follow the instructions for installation and tutorial for usage in our [documentation](https://www.quantconnect.com/docs/v2/lean-cli/getting-started/lean-cli)
|
||||
|
||||
<br />
|
||||
|
||||
<h2>Activate File Sharing for Docker:</h2>
|
||||
<h2>Option 2: Install Dependencies Locally</h2>
|
||||
|
||||
* Windows:
|
||||
* [Guide to sharing](https://docs.docker.com/docker-for-windows/#file-sharing)
|
||||
* Share the LEAN root directory with docker
|
||||
|
||||
* Mac:
|
||||
* [Guide to sharing](https://docs.docker.com/docker-for-mac/#file-sharing)
|
||||
* Share the LEAN root directory with docker
|
||||
1. Install [.Net 5](https://dotnet.microsoft.com/download) for the project
|
||||
|
||||
* Linux:
|
||||
* (No setup required)
|
||||
2. (Optional) Get [Python 3.6.8](https://www.python.org/downloads/release/python-368/) for running Python algorithms
|
||||
- Follow Python instructions [here](https://github.com/QuantConnect/Lean/tree/master/Algorithm.Python#installing-python-36) for your platform
|
||||
|
||||
3. Get [Visual Studio Code](https://code.visualstudio.com/download)
|
||||
- Get the Extension [C#](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp) for C# Debugging
|
||||
- Get the Extension [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python) for Python Debugging
|
||||
|
||||
4. Get Lean into VS Code
|
||||
- Download the repo or clone it using: _git clone [https://github.com/QuantConnect/Lean](https://github.com/QuantConnect/Lean)_
|
||||
- Open the folder using VS Code
|
||||
|
||||
Your environment is prepared and ready to run lean
|
||||
|
||||
<br />
|
||||
|
||||
<h2>Lean Configuration</h2>
|
||||
<h1>How to use Lean</h1>
|
||||
|
||||
Next we need to be sure that our Lean configuration at **.\Launcher\config.json** is properly set. Just like running lean locally the config must reflect what we want Lean to run.
|
||||
This section will cover configuring, building, launching and debugging lean. This is only applicable to option 2 from above. This does not apply to Lean CLI, please refer to [CLI documentation](https://www.quantconnect.com/docs/v2/lean-cli/getting-started/lean-cli)
|
||||
|
||||
<br />
|
||||
|
||||
<h2>Configuration</h2>
|
||||
|
||||
We need to be sure that our Lean configuration at **.\Launcher\config.json** is properly set.
|
||||
|
||||
Your configuration file should look something like this for the following languages:
|
||||
|
||||
@@ -85,74 +63,34 @@ Your configuration file should look something like this for the following langua
|
||||
|
||||
"algorithm-location": "QuantConnect.Algorithm.CSharp.dll",
|
||||
|
||||
<br />
|
||||
|
||||
<h3>Important Note About C#</h3>
|
||||
<h2>Building</h2>
|
||||
|
||||
In order to use a custom C# algorithm, the C# file must be compiled before running in the docker, as it is compiled into the file "QuantConnect.Algorithm.CSharp.dll". Any new C# files will need to be added to the csproj compile list before it will compile, check Algorithm.CSharp/QuantConnect.Algorithm.CSharp.csproj for all algorithms that are compiled. Once there is an entry for your algorithm the project can be compiled by using the “build” task under _“Terminal” > “Run Build Task”._
|
||||
Before running Lean, we must build the project. Currently the VS Code task will automatically build before launching. But find more information below about how to trigger building manually.
|
||||
|
||||
Python **does not** have this requirement as the engine will compile it on the fly.
|
||||
In VS Code run build task (Ctrl+Shift+B or "Terminal" dropdown); there are a few options:
|
||||
|
||||
- __Build__ - basic build task, just builds Lean once
|
||||
- __Rebuild__ - rebuild task, completely rebuilds the project. Use if having issues with debugging symbols being loaded for your algorithms.
|
||||
- __Autobuilder__ - Starts a script that builds then waits for files to change and rebuilds appropriately
|
||||
- __Clean__ - deletes out all project build files
|
||||
|
||||
<br />
|
||||
|
||||
<h2>Running Lean in the Container</h2>
|
||||
<h2>Launching Lean</h2>
|
||||
|
||||
This section will cover how to actually launch Lean in the container with your desired configuration.
|
||||
Now that lean is configured and built we can launch Lean. Under "Run & Debug" use the launch option "Launch". This will start Lean with C# debugging. Any breakpoints in Lean C# will be triggered.
|
||||
|
||||
<br />
|
||||
|
||||
<h3>Option 1 (Recommended)</h3>
|
||||
|
||||
In VS Code click on the debug/run icon on the left toolbar, at the top you should see a drop down menu with launch options, be sure to select **Debug in Container**. This option will kick off a launch script that will start the docker. With this specific launch option the parameters are already configured in VS Codes **tasks.json** under the **run-docker** task args. These set arguments are:
|
||||
|
||||
"IMAGE=quantconnect/lean:latest",
|
||||
"CONFIG_FILE=${workspaceFolder}/Launcher/config.json",
|
||||
"DATA_DIR=${workspaceFolder}/Data",
|
||||
"RESULTS_DIR=${workspaceFolder}/Results",
|
||||
"DEBUGGING=Y",
|
||||
"PYHTON_DIR=${workspaceFolder}/Algorithm.Python"
|
||||
|
||||
As defaults these are all great! Feel free to change them as needed for your setup.
|
||||
|
||||
**NOTE:** VSCode may try and throw errors when launching this way regarding build on `QuantConnect.csx` and `Config.json` these errors can be ignored by selecting "*Debug Anyway*". To stop this error message in the future select "*Remember my choice in user settings*".
|
||||
|
||||
If using C# algorithms ensure that msbuild can build them successfully.
|
||||
|
||||
<h2>Debugging Python</h2>
|
||||
|
||||
Python algorithms require a little extra work in order to be able to debug them. Follow the steps below to get Python debugging working.
|
||||
|
||||
<br />
|
||||
|
||||
<h3>Option 2</h3>
|
||||
|
||||
From a terminal launch the run_docker.bat/.sh script; there are a few choices on how to launch this:
|
||||
1. Launch with no parameters and answer the questions regarding configuration (Press enter for defaults)
|
||||
|
||||
* Enter docker image [default: quantconnect/lean:latest]:
|
||||
* Enter absolute path to Lean config file [default: .\Launcher\config.json]:
|
||||
* Enter absolute path to Data folder [default: .\Data\]:
|
||||
* Enter absolute path to store results [default: .\Results]:
|
||||
* Would you like to debug C#? (Requires mono debugger attachment) [default: N]:
|
||||
|
||||
2. Using the **run_docker.cfg** to store args for repeated use; any blank entries will resort to default values! example: **_./run_docker.bat run_docker.cfg_**
|
||||
|
||||
IMAGE=quantconnect/lean:latest
|
||||
CONFIG_FILE=
|
||||
DATA_DIR=
|
||||
RESULTS_DIR=
|
||||
DEBUGGING=
|
||||
PYTHON_DIR=
|
||||
|
||||
3. Inline arguments; anything you don't enter will use the default args! example: **_./run_docker.bat DEBUGGING=y_**
|
||||
* Accepted args for inline include all listed in the file in #2
|
||||
|
||||
<br />
|
||||
|
||||
<h1>Debugging Python</h1>
|
||||
|
||||
Python algorithms require a little extra work in order to be able to debug them locally or in the container. Thankfully we were able to configure VS code tasks to take care of the work for you! Follow the steps below to get Python debugging working.
|
||||
|
||||
<br />
|
||||
|
||||
<h2>Modifying the Configuration</h2>
|
||||
<h3>Modifying the Configuration</h3>
|
||||
|
||||
First in order to debug a Python algorithm in VS Code we must make the following change to our configuration (Launcher\config.json) under the comment debugging configuration:
|
||||
|
||||
@@ -163,27 +101,11 @@ In setting this we are telling Lean to expect a debugger connection using ‘Pyt
|
||||
|
||||
<br />
|
||||
|
||||
<h2>Using VS Code Launch Options to Connect</h2>
|
||||
<h3>Using VS Code Launch Options to Connect</h3>
|
||||
|
||||
Now that Lean is configured for the python debugger we can make use of the programmed launch options to connect.
|
||||
Now that Lean is configured for the python debugger we can make use of the programmed launch options to connect to Lean during runtime.
|
||||
|
||||
<br />
|
||||
|
||||
<h3>Container</h3>
|
||||
|
||||
|
||||
To debug inside of the container we must first start the container, follow the steps described in the section “[Running Lean in the Container](#Running-Lean-in-the-Container)”. Once the container is started you should see the messages in Figure 2.
|
||||
|
||||
If the message is displayed, use the same drop down for “Debug in Container” and select “Attach to Python (Container)”. Then press run, VS Code will now enter and debug any breakpoints you have set in your Python algorithm.
|
||||
|
||||
<br />
|
||||
|
||||
<h3>Local</h3>
|
||||
|
||||
|
||||
To debug locally we must run the program locally using the programmed task found under Terminal > Run Task > “Run Application”. Once Lean is started you should see the messages in Figure 2.
|
||||
|
||||
If the message is displayed, use the launch option “Attach to Python (Local)”. Then press run, VS Code will now enter and debug any breakpoints you have set in your python algorithm.
|
||||
Start Lean using the "Launch" option covered above. Once Lean starts you should see the messages in figure 2 If the message is displayed, use the launch option “Attach to Python”. Then press run, VS Code will now enter and debug any breakpoints you have set in your python algorithm.
|
||||
|
||||
<br />
|
||||
|
||||
@@ -201,6 +123,5 @@ _Figure 2: Python Debugger Messages_
|
||||
<h1>Common Issues</h1>
|
||||
Here we will cover some common issues with setting this up. This section will expand as we get user feedback!
|
||||
|
||||
* Any error messages about building in VSCode that point to comments in JSON. Either select **ignore** or follow steps described [here](https://stackoverflow.com/questions/47834825/in-vs-code-disable-error-comments-are-not-permitted-in-json) to remove the errors entirely.
|
||||
* `Errors exist after running preLaunchTask 'run-docker'`This VSCode error appears to warn you of CSharp errors when trying to use `Debug in Container` select "Debug Anyway" as the errors are false flags for JSON comments as well as `QuantConnect.csx` not finding references. Neither of these will impact your debugging.
|
||||
* `The container name "/LeanEngine" is already in use by container "****"` This Docker error implies that another instance of lean is already running under the container name /LeanEngine. If this error appears either use Docker Desktop to delete the container or use `docker kill LeanEngine` from the command line.
|
||||
- Autocomplete and reference finding with omnisharp can sometimes bug, if this occurs use the command palette to restart omnisharp. (Ctrl+Shift+P "OmniSharp: Restart OmniSharp")
|
||||
- Any error messages about building in VSCode that point to comments in JSON. Either select **ignore** or follow steps described [here](https://stackoverflow.com/questions/47834825/in-vs-code-disable-error-comments-are-not-permitted-in-json) to remove the errors entirely.
|
||||
|
||||
102
.vscode/tasks.json
vendored
102
.vscode/tasks.json
vendored
@@ -8,11 +8,12 @@
|
||||
{
|
||||
"label": "build",
|
||||
"type": "shell",
|
||||
"command": "msbuild",
|
||||
"command": "dotnet",
|
||||
"args": [
|
||||
"build",
|
||||
"/p:Configuration=Debug",
|
||||
"/p:DebugType=portable",
|
||||
"/t:build",
|
||||
"/p:WarningLevel=1"
|
||||
],
|
||||
"group": "build",
|
||||
"presentation": {
|
||||
@@ -23,11 +24,13 @@
|
||||
{
|
||||
"label": "rebuild",
|
||||
"type": "shell",
|
||||
"command": "msbuild",
|
||||
"command": "dotnet",
|
||||
"args": [
|
||||
"build",
|
||||
"--no-incremental",
|
||||
"/p:Configuration=Debug",
|
||||
"/p:DebugType=portable",
|
||||
"/t:rebuild",
|
||||
"/p:WarningLevel=1"
|
||||
],
|
||||
"group": "build",
|
||||
"presentation": {
|
||||
@@ -38,102 +41,15 @@
|
||||
{
|
||||
"label": "clean",
|
||||
"type": "shell",
|
||||
"command": "msbuild",
|
||||
"command": "dotnet",
|
||||
"args": [
|
||||
"/t:clean",
|
||||
"clean",
|
||||
],
|
||||
"group": "build",
|
||||
"presentation": {
|
||||
"reveal": "silent"
|
||||
},
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "force build linux",
|
||||
"type": "shell",
|
||||
"command": "msbuild",
|
||||
"args": [
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/p:Configuration=Debug",
|
||||
"/p:DebugType=portable",
|
||||
"/t:build",
|
||||
"/p:ForceLinuxBuild=true"
|
||||
],
|
||||
"group": "build",
|
||||
"presentation": {
|
||||
"reveal": "silent"
|
||||
},
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "run-docker",
|
||||
"type": "shell",
|
||||
"isBackground": true,
|
||||
"windows": {
|
||||
"command": "${workspaceFolder}/run_docker.bat",
|
||||
},
|
||||
"linux": {
|
||||
"command": "${workspaceFolder}/run_docker.sh"
|
||||
},
|
||||
"osx": {
|
||||
"command": "${workspaceFolder}/run_docker.sh"
|
||||
},
|
||||
"args": [
|
||||
"IMAGE=quantconnect/lean:latest",
|
||||
"CONFIG_FILE=${workspaceFolder}/Launcher/config.json",
|
||||
"DATA_DIR=${workspaceFolder}/Data",
|
||||
"RESULTS_DIR=${workspaceFolder}/Results",
|
||||
"DEBUGGING=Y",
|
||||
"PYTHON_DIR=${workspaceFolder}/Algorithm.Python",
|
||||
"EXIT=Y"
|
||||
],
|
||||
"problemMatcher": [
|
||||
{
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": ".",
|
||||
"file": 1,
|
||||
"location": 2,
|
||||
"message": 3
|
||||
}
|
||||
],
|
||||
"background": {
|
||||
"activeOnStart": true,
|
||||
"beginsPattern": ".",
|
||||
"endsPattern": ".",
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "close-docker",
|
||||
"type": "shell",
|
||||
"command": "docker stop LeanEngine",
|
||||
"presentation": {
|
||||
"echo": false,
|
||||
"reveal": "never",
|
||||
"focus": false,
|
||||
"panel": "shared",
|
||||
"showReuseMessage": false,
|
||||
"clear": true,
|
||||
},
|
||||
"linux":{
|
||||
"command": "sudo docker stop LeanEngine"
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "Run Application",
|
||||
"type": "process",
|
||||
"command": "QuantConnect.Lean.Launcher.exe",
|
||||
"args" : [
|
||||
"--data-folder",
|
||||
"${workspaceFolder}/Data",
|
||||
"--config",
|
||||
"${workspaceFolder}/Launcher/config.json"
|
||||
],
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}/Launcher/bin/Debug/"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -77,44 +77,45 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Trades", "199"},
|
||||
{"Average Win", "0.00%"},
|
||||
{"Average Loss", "0.00%"},
|
||||
{"Compounding Annual Return", "-12.472%"},
|
||||
{"Compounding Annual Return", "-12.611%"},
|
||||
{"Drawdown", "0.200%"},
|
||||
{"Expectancy", "-0.586"},
|
||||
{"Net Profit", "-0.170%"},
|
||||
{"Sharpe Ratio", "-9.693"},
|
||||
{"Probabilistic Sharpe Ratio", "12.704%"},
|
||||
{"Loss Rate", "79%"},
|
||||
{"Win Rate", "21%"},
|
||||
{"Profit-Loss Ratio", "0.95"},
|
||||
{"Expectancy", "-0.585"},
|
||||
{"Net Profit", "-0.172%"},
|
||||
{"Sharpe Ratio", "-10.169"},
|
||||
{"Probabilistic Sharpe Ratio", "12.075%"},
|
||||
{"Loss Rate", "78%"},
|
||||
{"Win Rate", "22%"},
|
||||
{"Profit-Loss Ratio", "0.87"},
|
||||
{"Alpha", "-0.149"},
|
||||
{"Beta", "0.037"},
|
||||
{"Beta", "0.035"},
|
||||
{"Annual Standard Deviation", "0.008"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-9.471"},
|
||||
{"Tracking Error", "0.212"},
|
||||
{"Treynor Ratio", "-2.13"},
|
||||
{"Information Ratio", "-9.603"},
|
||||
{"Tracking Error", "0.215"},
|
||||
{"Treynor Ratio", "-2.264"},
|
||||
{"Total Fees", "$199.00"},
|
||||
{"Estimated Strategy Capacity", "$23000000.00"},
|
||||
{"Estimated Strategy Capacity", "$26000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.002"},
|
||||
{"Kelly Criterion Estimate", "38.64"},
|
||||
{"Kelly Criterion Probability Value", "0.229"},
|
||||
{"Sortino Ratio", "-21.545"},
|
||||
{"Return Over Maximum Drawdown", "-77.972"},
|
||||
{"Portfolio Turnover", "1.135"},
|
||||
{"Kelly Criterion Estimate", "38.796"},
|
||||
{"Kelly Criterion Probability Value", "0.228"},
|
||||
{"Sortino Ratio", "-22.493"},
|
||||
{"Return Over Maximum Drawdown", "-77.93"},
|
||||
{"Portfolio Turnover", "1.211"},
|
||||
{"Total Insights Generated", "100"},
|
||||
{"Total Insights Closed", "99"},
|
||||
{"Total Insights Analysis Completed", "99"},
|
||||
{"Long Insight Count", "100"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$126657.6305"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$20405.9516"},
|
||||
{"Mean Population Estimated Insight Value", "$206.1207"},
|
||||
{"Mean Population Direction", "54.5455%"},
|
||||
{"Mean Population Magnitude", "54.5455%"},
|
||||
{"Rolling Averaged Population Direction", "59.8056%"},
|
||||
{"Rolling Averaged Population Magnitude", "59.8056%"},
|
||||
{"OrderListHash", "0a28eedf6304023f5002ef672b489b88"}
|
||||
{"Estimated Monthly Alpha Value", "$135639.1761"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$21852.9784"},
|
||||
{"Mean Population Estimated Insight Value", "$220.7372"},
|
||||
{"Mean Population Direction", "53.5354%"},
|
||||
{"Mean Population Magnitude", "53.5354%"},
|
||||
{"Rolling Averaged Population Direction", "58.2788%"},
|
||||
{"Rolling Averaged Population Magnitude", "58.2788%"},
|
||||
{"OrderListHash", "3c4c4085810cc5ecdb927d3647b9bbf3"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,31 +111,32 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "9"},
|
||||
{"Average Win", "0.89%"},
|
||||
{"Average Win", "0.86%"},
|
||||
{"Average Loss", "-0.27%"},
|
||||
{"Compounding Annual Return", "196.104%"},
|
||||
{"Compounding Annual Return", "184.364%"},
|
||||
{"Drawdown", "1.700%"},
|
||||
{"Expectancy", "1.853"},
|
||||
{"Net Profit", "1.498%"},
|
||||
{"Sharpe Ratio", "4.275"},
|
||||
{"Probabilistic Sharpe Ratio", "60.462%"},
|
||||
{"Expectancy", "1.781"},
|
||||
{"Net Profit", "1.442%"},
|
||||
{"Sharpe Ratio", "4.017"},
|
||||
{"Probabilistic Sharpe Ratio", "59.636%"},
|
||||
{"Loss Rate", "33%"},
|
||||
{"Win Rate", "67%"},
|
||||
{"Profit-Loss Ratio", "3.28"},
|
||||
{"Alpha", "1.574"},
|
||||
{"Beta", "-0.289"},
|
||||
{"Annual Standard Deviation", "0.276"},
|
||||
{"Annual Variance", "0.076"},
|
||||
{"Information Ratio", "-0.495"},
|
||||
{"Tracking Error", "0.367"},
|
||||
{"Treynor Ratio", "-4.079"},
|
||||
{"Total Fees", "$14.33"},
|
||||
{"Estimated Strategy Capacity", "$38000000.00"},
|
||||
{"Profit-Loss Ratio", "3.17"},
|
||||
{"Alpha", "1.53"},
|
||||
{"Beta", "-0.292"},
|
||||
{"Annual Standard Deviation", "0.279"},
|
||||
{"Annual Variance", "0.078"},
|
||||
{"Information Ratio", "-0.743"},
|
||||
{"Tracking Error", "0.372"},
|
||||
{"Treynor Ratio", "-3.845"},
|
||||
{"Total Fees", "$14.78"},
|
||||
{"Estimated Strategy Capacity", "$47000000.00"},
|
||||
{"Lowest Capacity Asset", "IBM R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.408"},
|
||||
{"Kelly Criterion Estimate", "16.447"},
|
||||
{"Kelly Criterion Probability Value", "0.315"},
|
||||
{"Sortino Ratio", "13.611"},
|
||||
{"Return Over Maximum Drawdown", "117.635"},
|
||||
{"Kelly Criterion Estimate", "16.559"},
|
||||
{"Kelly Criterion Probability Value", "0.316"},
|
||||
{"Sortino Ratio", "12.447"},
|
||||
{"Return Over Maximum Drawdown", "106.327"},
|
||||
{"Portfolio Turnover", "0.411"},
|
||||
{"Total Insights Generated", "3"},
|
||||
{"Total Insights Closed", "3"},
|
||||
@@ -143,14 +144,14 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "3"},
|
||||
{"Long/Short Ratio", "0%"},
|
||||
{"Estimated Monthly Alpha Value", "$19868365.6628"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$3421774.0864"},
|
||||
{"Mean Population Estimated Insight Value", "$1140591.3621"},
|
||||
{"Estimated Monthly Alpha Value", "$20784418.6104"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$3579538.7607"},
|
||||
{"Mean Population Estimated Insight Value", "$1193179.5869"},
|
||||
{"Mean Population Direction", "100%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "100%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "506e9fe18984ba6e569b2e327030de3a"}
|
||||
{"OrderListHash", "9da9afe1e9137638a55db1676adc2be1"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,6 +186,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$7.40"},
|
||||
{"Estimated Strategy Capacity", "$28000000.00"},
|
||||
{"Lowest Capacity Asset", "ES XFH59UK0MYO1"},
|
||||
{"Fitness Score", "1"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
|
||||
@@ -21,6 +21,7 @@ using QuantConnect.Data.Market;
|
||||
using QuantConnect.Interfaces;
|
||||
using QuantConnect.Securities;
|
||||
using QuantConnect.Securities.Future;
|
||||
using QuantConnect.Securities.Option;
|
||||
|
||||
namespace QuantConnect.Algorithm.CSharp
|
||||
{
|
||||
@@ -123,9 +124,33 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
|
||||
if (!optionInvested && data.ContainsKey(option))
|
||||
{
|
||||
var optionContract = Securities[option];
|
||||
var marginModel = optionContract.BuyingPowerModel as FuturesOptionsMarginModel;
|
||||
if (marginModel.InitialIntradayMarginRequirement == 0
|
||||
|| marginModel.InitialOvernightMarginRequirement == 0
|
||||
|| marginModel.MaintenanceIntradayMarginRequirement == 0
|
||||
|| marginModel.MaintenanceOvernightMarginRequirement == 0)
|
||||
{
|
||||
throw new Exception("Unexpected margin requirements");
|
||||
}
|
||||
|
||||
if (marginModel.GetInitialMarginRequirement(optionContract, 1) == 0)
|
||||
{
|
||||
throw new Exception("Unexpected Initial Margin requirement");
|
||||
}
|
||||
if (marginModel.GetMaintenanceMargin(optionContract) != 0)
|
||||
{
|
||||
throw new Exception("Unexpected Maintenance Margin requirement");
|
||||
}
|
||||
|
||||
MarketOrder(option, 1);
|
||||
_invested = true;
|
||||
optionInvested = true;
|
||||
|
||||
if (marginModel.GetMaintenanceMargin(optionContract) == 0)
|
||||
{
|
||||
throw new Exception("Unexpected Maintenance Margin requirement");
|
||||
}
|
||||
}
|
||||
if (!futureInvested && data.ContainsKey(future))
|
||||
{
|
||||
@@ -219,7 +244,8 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Tracking Error", "0.044"},
|
||||
{"Treynor Ratio", "0.479"},
|
||||
{"Total Fees", "$3.70"},
|
||||
{"Estimated Strategy Capacity", "$12000.00"},
|
||||
{"Estimated Strategy Capacity", "$41000.00"},
|
||||
{"Lowest Capacity Asset", "ES 31C3JQTOYO9T0|ES XCZJLC9NOB29"},
|
||||
{"Fitness Score", "0.41"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
|
||||
@@ -132,14 +132,15 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Win Rate", "50%"},
|
||||
{"Profit-Loss Ratio", "0.92"},
|
||||
{"Alpha", "-0.021"},
|
||||
{"Beta", "-0.01"},
|
||||
{"Beta", "-0.011"},
|
||||
{"Annual Standard Deviation", "0.006"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-3.374"},
|
||||
{"Information Ratio", "-3.385"},
|
||||
{"Tracking Error", "0.058"},
|
||||
{"Treynor Ratio", "2.133"},
|
||||
{"Treynor Ratio", "2.117"},
|
||||
{"Total Fees", "$2.00"},
|
||||
{"Estimated Strategy Capacity", "$45000000.00"},
|
||||
{"Lowest Capacity Asset", "AOL R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
|
||||
@@ -183,15 +183,16 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "0.027"},
|
||||
{"Beta", "-0.174"},
|
||||
{"Alpha", "0.024"},
|
||||
{"Beta", "-0.171"},
|
||||
{"Annual Standard Deviation", "0.006"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-11.586"},
|
||||
{"Tracking Error", "0.042"},
|
||||
{"Treynor Ratio", "0.286"},
|
||||
{"Information Ratio", "-11.082"},
|
||||
{"Tracking Error", "0.043"},
|
||||
{"Treynor Ratio", "0.291"},
|
||||
{"Total Fees", "$2.00"},
|
||||
{"Estimated Strategy Capacity", "$2800000.00"},
|
||||
{"Lowest Capacity Asset", "AOL VRKS95ENLBYE|AOL R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
|
||||
@@ -79,19 +79,19 @@ 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(LinqExtensions.ToHashSet(Securities.Keys)))
|
||||
if (_expectedSecurities.AreDifferent(Securities.Keys.ToHashSet()))
|
||||
{
|
||||
var expected = string.Join(Environment.NewLine, _expectedSecurities.OrderBy(s => s.ToString()));
|
||||
var actual = string.Join(Environment.NewLine, Securities.Keys.OrderBy(s => s.ToString()));
|
||||
throw new Exception($"{Time}:: Detected differences in expected and actual securities{Environment.NewLine}Expected:{Environment.NewLine}{expected}{Environment.NewLine}Actual:{Environment.NewLine}{actual}");
|
||||
}
|
||||
if (_expectedUniverses.AreDifferent(LinqExtensions.ToHashSet(UniverseManager.Keys)))
|
||||
if (_expectedUniverses.AreDifferent(UniverseManager.Keys.ToHashSet()))
|
||||
{
|
||||
var expected = string.Join(Environment.NewLine, _expectedUniverses.OrderBy(s => s.ToString()));
|
||||
var actual = string.Join(Environment.NewLine, UniverseManager.Keys.OrderBy(s => s.ToString()));
|
||||
throw new Exception($"{Time}:: Detected differences in expected and actual universes{Environment.NewLine}Expected:{Environment.NewLine}{expected}{Environment.NewLine}Actual:{Environment.NewLine}{actual}");
|
||||
}
|
||||
if (_expectedData.AreDifferent(LinqExtensions.ToHashSet(data.Keys)))
|
||||
if (_expectedData.AreDifferent(data.Keys.ToHashSet()))
|
||||
{
|
||||
var expected = string.Join(Environment.NewLine, _expectedData.OrderBy(s => s.ToString()));
|
||||
var actual = string.Join(Environment.NewLine, data.Keys.OrderBy(s => s.ToString()));
|
||||
@@ -183,7 +183,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
if (changes.RemovedSecurities
|
||||
.Where(x => x.Symbol.SecurityType == SecurityType.Option)
|
||||
.ToHashSet(s => s.Symbol)
|
||||
.AreDifferent(LinqExtensions.ToHashSet(_expectedContracts)))
|
||||
.AreDifferent(_expectedContracts.ToHashSet()))
|
||||
{
|
||||
throw new Exception("Expected removed securities to equal expected contracts added");
|
||||
}
|
||||
@@ -230,7 +230,8 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Tracking Error", "0"},
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$6.00"},
|
||||
{"Estimated Strategy Capacity", "$1500.00"},
|
||||
{"Estimated Strategy Capacity", "$2000.00"},
|
||||
{"Lowest Capacity Asset", "GOOCV 305RBQ2BZBZT2|GOOCV VP83T1ZUHROL"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
@@ -250,7 +251,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "cf8f76fa441c2a5e3b2dbbabcab32cd2"}
|
||||
{"OrderListHash", "1e7b3e90918777b9dbf46353a96f3329"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,31 +112,32 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "5"},
|
||||
{"Average Win", "0.47%"},
|
||||
{"Average Win", "0.46%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "293.067%"},
|
||||
{"Compounding Annual Return", "296.356%"},
|
||||
{"Drawdown", "1.400%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "1.765%"},
|
||||
{"Sharpe Ratio", "13.11"},
|
||||
{"Probabilistic Sharpe Ratio", "80.231%"},
|
||||
{"Net Profit", "1.776%"},
|
||||
{"Sharpe Ratio", "13.013"},
|
||||
{"Probabilistic Sharpe Ratio", "80.409%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "100%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "0.705"},
|
||||
{"Beta", "0.7"},
|
||||
{"Annual Standard Deviation", "0.157"},
|
||||
{"Annual Variance", "0.025"},
|
||||
{"Information Ratio", "1.76"},
|
||||
{"Alpha", "0.68"},
|
||||
{"Beta", "0.707"},
|
||||
{"Annual Standard Deviation", "0.16"},
|
||||
{"Annual Variance", "0.026"},
|
||||
{"Information Ratio", "1.378"},
|
||||
{"Tracking Error", "0.072"},
|
||||
{"Treynor Ratio", "2.933"},
|
||||
{"Total Fees", "$26.39"},
|
||||
{"Estimated Strategy Capacity", "$4400000.00"},
|
||||
{"Treynor Ratio", "2.946"},
|
||||
{"Total Fees", "$28.30"},
|
||||
{"Estimated Strategy Capacity", "$4700000.00"},
|
||||
{"Lowest Capacity Asset", "AIG R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.374"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "373.973"},
|
||||
{"Return Over Maximum Drawdown", "372.086"},
|
||||
{"Portfolio Turnover", "0.374"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
@@ -151,7 +152,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "5f7ba8b5defb310a2eaf98b11abd3b74"}
|
||||
{"OrderListHash", "ac3f4dfcdeb98b488b715412ad2d6c4f"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,29 +67,30 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Trades", "3"},
|
||||
{"Average Win", "1.02%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "289.119%"},
|
||||
{"Compounding Annual Return", "296.066%"},
|
||||
{"Drawdown", "2.200%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "1.752%"},
|
||||
{"Sharpe Ratio", "9.235"},
|
||||
{"Probabilistic Sharpe Ratio", "68.013%"},
|
||||
{"Net Profit", "1.775%"},
|
||||
{"Sharpe Ratio", "9.373"},
|
||||
{"Probabilistic Sharpe Ratio", "68.302%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "100%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "0.105"},
|
||||
{"Beta", "1.022"},
|
||||
{"Annual Standard Deviation", "0.224"},
|
||||
{"Annual Variance", "0.05"},
|
||||
{"Information Ratio", "24.59"},
|
||||
{"Beta", "1.021"},
|
||||
{"Annual Standard Deviation", "0.227"},
|
||||
{"Annual Variance", "0.052"},
|
||||
{"Information Ratio", "25.083"},
|
||||
{"Tracking Error", "0.006"},
|
||||
{"Treynor Ratio", "2.029"},
|
||||
{"Total Fees", "$9.77"},
|
||||
{"Estimated Strategy Capacity", "$37000000.00"},
|
||||
{"Treynor Ratio", "2.086"},
|
||||
{"Total Fees", "$10.33"},
|
||||
{"Estimated Strategy Capacity", "$38000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.747"},
|
||||
{"Kelly Criterion Estimate", "38.64"},
|
||||
{"Kelly Criterion Probability Value", "0.229"},
|
||||
{"Kelly Criterion Estimate", "38.796"},
|
||||
{"Kelly Criterion Probability Value", "0.228"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "107.109"},
|
||||
{"Return Over Maximum Drawdown", "107.013"},
|
||||
{"Portfolio Turnover", "0.747"},
|
||||
{"Total Insights Generated", "100"},
|
||||
{"Total Insights Closed", "99"},
|
||||
@@ -97,14 +98,14 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Long Insight Count", "100"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$126657.6305"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$20405.9516"},
|
||||
{"Mean Population Estimated Insight Value", "$206.1207"},
|
||||
{"Mean Population Direction", "54.5455%"},
|
||||
{"Mean Population Magnitude", "54.5455%"},
|
||||
{"Rolling Averaged Population Direction", "59.8056%"},
|
||||
{"Rolling Averaged Population Magnitude", "59.8056%"},
|
||||
{"OrderListHash", "0b8cbbafdb77bae2f7abe3cf5e05ac5c"}
|
||||
{"Estimated Monthly Alpha Value", "$135639.1761"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$21852.9784"},
|
||||
{"Mean Population Estimated Insight Value", "$220.7372"},
|
||||
{"Mean Population Direction", "53.5354%"},
|
||||
{"Mean Population Magnitude", "53.5354%"},
|
||||
{"Rolling Averaged Population Direction", "58.2788%"},
|
||||
{"Rolling Averaged Population Magnitude", "58.2788%"},
|
||||
{"OrderListHash", "af3a9c98c190d1b6b36fad184e796b0b"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,33 +83,34 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "10"},
|
||||
{"Total Trades", "11"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "-0.01%"},
|
||||
{"Compounding Annual Return", "-14.333%"},
|
||||
{"Compounding Annual Return", "-14.217%"},
|
||||
{"Drawdown", "3.300%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "-0.169%"},
|
||||
{"Sharpe Ratio", "-0.131"},
|
||||
{"Probabilistic Sharpe Ratio", "45.057%"},
|
||||
{"Net Profit", "-0.168%"},
|
||||
{"Sharpe Ratio", "-0.126"},
|
||||
{"Probabilistic Sharpe Ratio", "45.081%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "-3.068"},
|
||||
{"Beta", "0.595"},
|
||||
{"Annual Standard Deviation", "0.382"},
|
||||
{"Annual Variance", "0.146"},
|
||||
{"Information Ratio", "-13.618"},
|
||||
{"Tracking Error", "0.376"},
|
||||
{"Treynor Ratio", "-0.084"},
|
||||
{"Total Fees", "$13.98"},
|
||||
{"Estimated Strategy Capacity", "$61000000.00"},
|
||||
{"Fitness Score", "0.146"},
|
||||
{"Alpha", "-2.896"},
|
||||
{"Beta", "0.551"},
|
||||
{"Annual Standard Deviation", "0.385"},
|
||||
{"Annual Variance", "0.148"},
|
||||
{"Information Ratio", "-13.66"},
|
||||
{"Tracking Error", "0.382"},
|
||||
{"Treynor Ratio", "-0.088"},
|
||||
{"Total Fees", "$23.21"},
|
||||
{"Estimated Strategy Capacity", "$340000000.00"},
|
||||
{"Lowest Capacity Asset", "FB V6OIPNZEM8V9"},
|
||||
{"Fitness Score", "0.147"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "1"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "-4.398"},
|
||||
{"Portfolio Turnover", "0.268"},
|
||||
{"Return Over Maximum Drawdown", "-4.352"},
|
||||
{"Portfolio Turnover", "0.269"},
|
||||
{"Total Insights Generated", "15"},
|
||||
{"Total Insights Closed", "12"},
|
||||
{"Total Insights Analysis Completed", "12"},
|
||||
@@ -123,7 +124,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "8971c92ba163cec8526379865d9b9ee4"}
|
||||
{"OrderListHash", "a7a0983c8413ff241e7d223438f3d508"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,33 +90,34 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "23"},
|
||||
{"Total Trades", "25"},
|
||||
{"Average Win", "0.00%"},
|
||||
{"Average Loss", "-0.01%"},
|
||||
{"Compounding Annual Return", "-75.307%"},
|
||||
{"Compounding Annual Return", "-75.314%"},
|
||||
{"Drawdown", "5.800%"},
|
||||
{"Expectancy", "-0.859"},
|
||||
{"Net Profit", "-5.586%"},
|
||||
{"Sharpe Ratio", "-3.257"},
|
||||
{"Probabilistic Sharpe Ratio", "5.931%"},
|
||||
{"Loss Rate", "92%"},
|
||||
{"Win Rate", "8%"},
|
||||
{"Profit-Loss Ratio", "0.70"},
|
||||
{"Alpha", "-0.593"},
|
||||
{"Beta", "0.692"},
|
||||
{"Annual Standard Deviation", "0.204"},
|
||||
{"Annual Variance", "0.042"},
|
||||
{"Information Ratio", "-2.884"},
|
||||
{"Tracking Error", "0.194"},
|
||||
{"Treynor Ratio", "-0.962"},
|
||||
{"Total Fees", "$25.92"},
|
||||
{"Estimated Strategy Capacity", "$69000000.00"},
|
||||
{"Expectancy", "-0.633"},
|
||||
{"Net Profit", "-5.587%"},
|
||||
{"Sharpe Ratio", "-3.271"},
|
||||
{"Probabilistic Sharpe Ratio", "5.832%"},
|
||||
{"Loss Rate", "75%"},
|
||||
{"Win Rate", "25%"},
|
||||
{"Profit-Loss Ratio", "0.47"},
|
||||
{"Alpha", "-0.594"},
|
||||
{"Beta", "0.707"},
|
||||
{"Annual Standard Deviation", "0.203"},
|
||||
{"Annual Variance", "0.041"},
|
||||
{"Information Ratio", "-2.928"},
|
||||
{"Tracking Error", "0.193"},
|
||||
{"Treynor Ratio", "-0.942"},
|
||||
{"Total Fees", "$35.25"},
|
||||
{"Estimated Strategy Capacity", "$520000000.00"},
|
||||
{"Lowest Capacity Asset", "AAPL R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.004"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "1"},
|
||||
{"Sortino Ratio", "-4.462"},
|
||||
{"Return Over Maximum Drawdown", "-13.032"},
|
||||
{"Portfolio Turnover", "0.083"},
|
||||
{"Sortino Ratio", "-4.468"},
|
||||
{"Return Over Maximum Drawdown", "-13.058"},
|
||||
{"Portfolio Turnover", "0.084"},
|
||||
{"Total Insights Generated", "33"},
|
||||
{"Total Insights Closed", "30"},
|
||||
{"Total Insights Analysis Completed", "30"},
|
||||
@@ -130,7 +131,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "ce59e51c8e404b5dbbc02911473aed1c"}
|
||||
{"OrderListHash", "c5553cbcef8480c184203c444794ccf1"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
205
Algorithm.CSharp/AdjustedVolumeRegressionAlgorithm.cs
Normal file
205
Algorithm.CSharp/AdjustedVolumeRegressionAlgorithm.cs
Normal file
@@ -0,0 +1,205 @@
|
||||
/*
|
||||
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
|
||||
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using QuantConnect.Configuration;
|
||||
using QuantConnect.Data;
|
||||
using QuantConnect.Data.Auxiliary;
|
||||
using QuantConnect.Interfaces;
|
||||
using QuantConnect.Util;
|
||||
|
||||
namespace QuantConnect.Algorithm.CSharp
|
||||
{
|
||||
/// <summary>
|
||||
/// Regression algorithm to test volume adjusted behavior
|
||||
/// </summary>
|
||||
public class AdjustedVolumeRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition
|
||||
{
|
||||
private Symbol _aapl;
|
||||
private const string Ticker = "AAPL";
|
||||
private FactorFile _factorFile;
|
||||
private readonly IEnumerator<decimal> _expectedAdjustedVolume = new List<decimal> { 6164842, 3044047, 3680347, 3468303, 2169943, 2652523,
|
||||
1499707, 1518215, 1655219, 1510487 }.GetEnumerator();
|
||||
private readonly IEnumerator<decimal> _expectedAdjustedAskSize = new List<decimal> { 215600, 5600, 25200, 8400, 5600, 5600, 2800,
|
||||
8400, 14000, 2800 }.GetEnumerator();
|
||||
private readonly IEnumerator<decimal> _expectedAdjustedBidSize = new List<decimal> { 2800, 11200, 2800, 2800, 2800, 5600, 11200,
|
||||
8400, 30800, 2800 }.GetEnumerator();
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
SetStartDate(2014, 6, 5); //Set Start Date
|
||||
SetEndDate(2014, 6, 5); //Set End Date
|
||||
|
||||
UniverseSettings.DataNormalizationMode = DataNormalizationMode.SplitAdjusted;
|
||||
_aapl = AddEquity(Ticker, Resolution.Minute).Symbol;
|
||||
|
||||
var dataProvider =
|
||||
Composer.Instance.GetExportedValueByTypeName<IDataProvider>(Config.Get("data-provider",
|
||||
"DefaultDataProvider"));
|
||||
|
||||
var mapFileProvider = new LocalDiskMapFileProvider();
|
||||
mapFileProvider.Initialize(dataProvider);
|
||||
var factorFileProvider = new LocalDiskFactorFileProvider();
|
||||
factorFileProvider.Initialize(mapFileProvider, dataProvider);
|
||||
|
||||
|
||||
_factorFile = factorFileProvider.Get(_aapl);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
|
||||
/// </summary>
|
||||
/// <param name="data">Slice object keyed by symbol containing the stock data</param>
|
||||
public override void OnData(Slice data)
|
||||
{
|
||||
if (!Portfolio.Invested)
|
||||
{
|
||||
SetHoldings(_aapl, 1);
|
||||
}
|
||||
|
||||
if (data.Splits.ContainsKey(_aapl))
|
||||
{
|
||||
Log(data.Splits[_aapl].ToString());
|
||||
}
|
||||
|
||||
if (data.Bars.ContainsKey(_aapl))
|
||||
{
|
||||
var aaplData = data.Bars[_aapl];
|
||||
|
||||
// Assert our volume matches what we expect
|
||||
if (_expectedAdjustedVolume.MoveNext() && _expectedAdjustedVolume.Current != aaplData.Volume)
|
||||
{
|
||||
// Our values don't match lets try and give a reason why
|
||||
var dayFactor = _factorFile.GetSplitFactor(aaplData.Time);
|
||||
var probableAdjustedVolume = aaplData.Volume / dayFactor;
|
||||
|
||||
if (_expectedAdjustedVolume.Current == probableAdjustedVolume)
|
||||
{
|
||||
throw new ArgumentException($"Volume was incorrect; but manually adjusted value is correct." +
|
||||
$" Adjustment by multiplying volume by {1 / dayFactor} is not occurring.");
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException($"Volume was incorrect; even when adjusted manually by" +
|
||||
$" multiplying volume by {1 / dayFactor}. Data may have changed.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (data.QuoteBars.ContainsKey(_aapl))
|
||||
{
|
||||
var aaplQuoteData = data.QuoteBars[_aapl];
|
||||
|
||||
// Assert our askSize matches what we expect
|
||||
if (_expectedAdjustedAskSize.MoveNext() && _expectedAdjustedAskSize.Current != aaplQuoteData.LastAskSize)
|
||||
{
|
||||
// Our values don't match lets try and give a reason why
|
||||
var dayFactor = _factorFile.GetSplitFactor(aaplQuoteData.Time);
|
||||
var probableAdjustedAskSize = aaplQuoteData.LastAskSize / dayFactor;
|
||||
|
||||
if (_expectedAdjustedAskSize.Current == probableAdjustedAskSize)
|
||||
{
|
||||
throw new ArgumentException($"Ask size was incorrect; but manually adjusted value is correct." +
|
||||
$" Adjustment by multiplying size by {1 / dayFactor} is not occurring.");
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException($"Ask size was incorrect; even when adjusted manually by" +
|
||||
$" multiplying size by {1 / dayFactor}. Data may have changed.");
|
||||
}
|
||||
}
|
||||
|
||||
// Assert our bidSize matches what we expect
|
||||
if (_expectedAdjustedBidSize.MoveNext() && _expectedAdjustedBidSize.Current != aaplQuoteData.LastBidSize)
|
||||
{
|
||||
// Our values don't match lets try and give a reason why
|
||||
var dayFactor = _factorFile.GetSplitFactor(aaplQuoteData.Time);
|
||||
var probableAdjustedBidSize = aaplQuoteData.LastBidSize / dayFactor;
|
||||
|
||||
if (_expectedAdjustedBidSize.Current == probableAdjustedBidSize)
|
||||
{
|
||||
throw new ArgumentException($"Bid size was incorrect; but manually adjusted value is correct." +
|
||||
$" Adjustment by multiplying size by {1 / dayFactor} is not occurring.");
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException($"Bid size was incorrect; even when adjusted manually by" +
|
||||
$" multiplying size by {1 / dayFactor}. Data may have changed.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <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>
|
||||
/// This is used by the regression test system to indicate what the expected statistics are from running the algorithm
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "1"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
{"Drawdown", "0%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "0"},
|
||||
{"Beta", "0"},
|
||||
{"Annual Standard Deviation", "0"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "0"},
|
||||
{"Tracking Error", "0"},
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$21.60"},
|
||||
{"Estimated Strategy Capacity", "$42000000.00"},
|
||||
{"Lowest Capacity Asset", "AAPL R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Return Over Maximum Drawdown", "0"},
|
||||
{"Portfolio Turnover", "0"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "18e41dded4f8cee548ee02b03ffb0814"}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -101,7 +101,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var symbol in ActiveSecurities.Keys)
|
||||
foreach (var symbol in ActiveSecurities.Keys.OrderBy(symbol => symbol))
|
||||
{
|
||||
if (!Portfolio.ContainsKey(symbol) || !Portfolio[symbol].Invested)
|
||||
{
|
||||
@@ -194,30 +194,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Trades", "5"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "36.294%"},
|
||||
{"Compounding Annual Return", "19.147%"},
|
||||
{"Drawdown", "0%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0.340%"},
|
||||
{"Sharpe Ratio", "21.2"},
|
||||
{"Probabilistic Sharpe Ratio", "99.990%"},
|
||||
{"Net Profit", "0.192%"},
|
||||
{"Sharpe Ratio", "31.331"},
|
||||
{"Probabilistic Sharpe Ratio", "88.448%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "0.274"},
|
||||
{"Beta", "0.138"},
|
||||
{"Annual Standard Deviation", "0.011"},
|
||||
{"Alpha", "0.138"},
|
||||
{"Beta", "0.04"},
|
||||
{"Annual Standard Deviation", "0.004"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "7.202"},
|
||||
{"Tracking Error", "0.068"},
|
||||
{"Treynor Ratio", "1.722"},
|
||||
{"Information Ratio", "4.767"},
|
||||
{"Tracking Error", "0.077"},
|
||||
{"Treynor Ratio", "3.223"},
|
||||
{"Total Fees", "$307.50"},
|
||||
{"Estimated Strategy Capacity", "$2800000.00"},
|
||||
{"Fitness Score", "0.173"},
|
||||
{"Estimated Strategy Capacity", "$2600000.00"},
|
||||
{"Lowest Capacity Asset", "GOOCV VP83T1ZUHROL"},
|
||||
{"Fitness Score", "0.106"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "79228162514264337593543950335"},
|
||||
{"Portfolio Turnover", "0.173"},
|
||||
{"Portfolio Turnover", "0.106"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
@@ -231,7 +232,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "6b1b205e5a6461ffd5bed645099714cd"}
|
||||
{"OrderListHash", "0069f402ffcd2d91b9018b81badfab81"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,32 +78,33 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "65"},
|
||||
{"Total Trades", "52"},
|
||||
{"Average Win", "0.00%"},
|
||||
{"Average Loss", "0.00%"},
|
||||
{"Compounding Annual Return", "0.145%"},
|
||||
{"Compounding Annual Return", "0.096%"},
|
||||
{"Drawdown", "0.100%"},
|
||||
{"Expectancy", "2.190"},
|
||||
{"Net Profit", "0.134%"},
|
||||
{"Sharpe Ratio", "0.993"},
|
||||
{"Probabilistic Sharpe Ratio", "49.669%"},
|
||||
{"Loss Rate", "29%"},
|
||||
{"Win Rate", "71%"},
|
||||
{"Profit-Loss Ratio", "3.50"},
|
||||
{"Expectancy", "3.321"},
|
||||
{"Net Profit", "0.089%"},
|
||||
{"Sharpe Ratio", "0.868"},
|
||||
{"Probabilistic Sharpe Ratio", "44.482%"},
|
||||
{"Loss Rate", "24%"},
|
||||
{"Win Rate", "76%"},
|
||||
{"Profit-Loss Ratio", "4.67"},
|
||||
{"Alpha", "0.001"},
|
||||
{"Beta", "0"},
|
||||
{"Beta", "-0"},
|
||||
{"Annual Standard Deviation", "0.001"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-2.168"},
|
||||
{"Tracking Error", "0.099"},
|
||||
{"Treynor Ratio", "-5.187"},
|
||||
{"Total Fees", "$65.00"},
|
||||
{"Estimated Strategy Capacity", "$16000000000.00"},
|
||||
{"Information Ratio", "-2.148"},
|
||||
{"Tracking Error", "0.101"},
|
||||
{"Treynor Ratio", "-4.168"},
|
||||
{"Total Fees", "$52.00"},
|
||||
{"Estimated Strategy Capacity", "$32000000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "1.51"},
|
||||
{"Return Over Maximum Drawdown", "1.819"},
|
||||
{"Sortino Ratio", "1.266"},
|
||||
{"Return Over Maximum Drawdown", "1.622"},
|
||||
{"Portfolio Turnover", "0"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
@@ -118,7 +119,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "c4c9c272037cfd8f6887052b8d739466"}
|
||||
{"OrderListHash", "cf43585a8d1781f04b53a4f1ee3380cb"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,15 +160,16 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "5.579"},
|
||||
{"Beta", "-63.972"},
|
||||
{"Alpha", "5.56"},
|
||||
{"Beta", "-71.105"},
|
||||
{"Annual Standard Deviation", "0.434"},
|
||||
{"Annual Variance", "0.188"},
|
||||
{"Information Ratio", "0.996"},
|
||||
{"Tracking Error", "0.441"},
|
||||
{"Treynor Ratio", "-0.008"},
|
||||
{"Information Ratio", "1.016"},
|
||||
{"Tracking Error", "0.44"},
|
||||
{"Treynor Ratio", "-0.007"},
|
||||
{"Total Fees", "$20.35"},
|
||||
{"Estimated Strategy Capacity", "$19000000.00"},
|
||||
{"Lowest Capacity Asset", "ES VMKLFZIH2MTD"},
|
||||
{"Fitness Score", "0.138"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
|
||||
@@ -113,29 +113,30 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Trades", "1"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "264.819%"},
|
||||
{"Compounding Annual Return", "271.453%"},
|
||||
{"Drawdown", "2.200%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "1.668%"},
|
||||
{"Sharpe Ratio", "8.749"},
|
||||
{"Probabilistic Sharpe Ratio", "67.311%"},
|
||||
{"Net Profit", "1.692%"},
|
||||
{"Sharpe Ratio", "8.888"},
|
||||
{"Probabilistic Sharpe Ratio", "67.609%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "-0.005"},
|
||||
{"Beta", "0.996"},
|
||||
{"Annual Standard Deviation", "0.219"},
|
||||
{"Annual Variance", "0.048"},
|
||||
{"Information Ratio", "-14.189"},
|
||||
{"Annual Standard Deviation", "0.222"},
|
||||
{"Annual Variance", "0.049"},
|
||||
{"Information Ratio", "-14.565"},
|
||||
{"Tracking Error", "0.001"},
|
||||
{"Treynor Ratio", "1.922"},
|
||||
{"Total Fees", "$3.26"},
|
||||
{"Estimated Strategy Capacity", "$58000000.00"},
|
||||
{"Treynor Ratio", "1.978"},
|
||||
{"Total Fees", "$3.44"},
|
||||
{"Estimated Strategy Capacity", "$56000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.248"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "93.761"},
|
||||
{"Return Over Maximum Drawdown", "93.728"},
|
||||
{"Portfolio Turnover", "0.248"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
@@ -150,7 +151,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "25885f979ca8c7b44f5d0f7daf00b241"}
|
||||
{"OrderListHash", "9e4bfd2eb0b81ee5bc1b197a87ccedbe"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,9 +76,11 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <param name="data">Slice object keyed by symbol containing the stock data</param>
|
||||
public override void OnData(Slice data)
|
||||
{
|
||||
if (!_equityBought && data.ContainsKey(_spy)) {
|
||||
//Buy our Equity
|
||||
var quantity = CalculateOrderQuantity(_spy, .1m);
|
||||
if (!_equityBought && data.ContainsKey(_spy))
|
||||
{
|
||||
//Buy our Equity.
|
||||
//Quantity is rounded down to an even number since it will be split in two equal halves
|
||||
var quantity = Math.Floor(CalculateOrderQuantity(_spy, .1m) / 2) * 2;
|
||||
_equityBuy = MarketOrder(_spy, quantity, asynchronous: true);
|
||||
_equityBought = true;
|
||||
}
|
||||
@@ -119,7 +121,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
var order = Transactions.GetOrderById(orderEvent.OrderId);
|
||||
|
||||
// Based on the type verify the order
|
||||
switch(order.Type)
|
||||
switch (order.Type)
|
||||
{
|
||||
case OrderType.Market:
|
||||
VerifyMarketOrder(order, orderEvent);
|
||||
@@ -140,7 +142,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// <param name="order">Order object to analyze</param>
|
||||
public void VerifyMarketOrder(Order order, OrderEvent orderEvent)
|
||||
{
|
||||
switch(order.Status)
|
||||
switch (order.Status)
|
||||
{
|
||||
case OrderStatus.Submitted:
|
||||
break;
|
||||
@@ -152,7 +154,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
throw new Exception("LastFillTime should not be null");
|
||||
}
|
||||
|
||||
if (order.Quantity/2 != orderEvent.FillQuantity)
|
||||
if (order.Quantity / 2 != orderEvent.FillQuantity)
|
||||
{
|
||||
throw new Exception("Order size should be half");
|
||||
}
|
||||
@@ -215,9 +217,9 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
}
|
||||
|
||||
//Check equity holding, should be invested, profit should be
|
||||
//Quantity should be 50, AveragePrice should be ticket AverageFillPrice
|
||||
//Quantity should be 52, AveragePrice should be ticket AverageFillPrice
|
||||
var equityHolding = Portfolio[_equityBuy.Symbol];
|
||||
if (!equityHolding.Invested || equityHolding.Quantity != 50 || equityHolding.AveragePrice != _equityBuy.AverageFillPrice)
|
||||
if (!equityHolding.Invested || equityHolding.Quantity != 52 || equityHolding.AveragePrice != _equityBuy.AverageFillPrice)
|
||||
{
|
||||
throw new Exception("Equity holding does not match expected outcome");
|
||||
}
|
||||
@@ -299,30 +301,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Trades", "3"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "-0.40%"},
|
||||
{"Compounding Annual Return", "-22.335%"},
|
||||
{"Compounding Annual Return", "-22.717%"},
|
||||
{"Drawdown", "0.400%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "-0.323%"},
|
||||
{"Sharpe Ratio", "-11.098"},
|
||||
{"Net Profit", "-0.329%"},
|
||||
{"Sharpe Ratio", "-11.083"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "-0.002"},
|
||||
{"Beta", "0.099"},
|
||||
{"Alpha", "-0.003"},
|
||||
{"Beta", "0.097"},
|
||||
{"Annual Standard Deviation", "0.002"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "9.899"},
|
||||
{"Tracking Error", "0.019"},
|
||||
{"Treynor Ratio", "-0.23"},
|
||||
{"Information Ratio", "9.742"},
|
||||
{"Tracking Error", "0.021"},
|
||||
{"Treynor Ratio", "-0.26"},
|
||||
{"Total Fees", "$2.00"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Fitness Score", "0.213"},
|
||||
{"Lowest Capacity Asset", "GOOCV VP83T1ZUHROL"},
|
||||
{"Fitness Score", "0.212"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "-73.456"},
|
||||
{"Portfolio Turnover", "0.426"},
|
||||
{"Return Over Maximum Drawdown", "-73.334"},
|
||||
{"Portfolio Turnover", "0.425"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
@@ -336,7 +339,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "72a6ced0ed0c2da7136f3be652eb4744"}
|
||||
{"OrderListHash", "7f99e1a8ce4675a1e8bbe1ba45967ccd"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,6 +89,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$85000.00"},
|
||||
{"Lowest Capacity Asset", "BTCEUR XJ"},
|
||||
{"Fitness Score", "0.506"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
|
||||
@@ -80,29 +80,30 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Trades", "1"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "264.819%"},
|
||||
{"Compounding Annual Return", "271.453%"},
|
||||
{"Drawdown", "2.200%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "1.668%"},
|
||||
{"Sharpe Ratio", "8.749"},
|
||||
{"Probabilistic Sharpe Ratio", "67.311%"},
|
||||
{"Net Profit", "1.692%"},
|
||||
{"Sharpe Ratio", "8.888"},
|
||||
{"Probabilistic Sharpe Ratio", "67.609%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "-0.005"},
|
||||
{"Beta", "0.996"},
|
||||
{"Annual Standard Deviation", "0.219"},
|
||||
{"Annual Variance", "0.048"},
|
||||
{"Information Ratio", "-14.189"},
|
||||
{"Annual Standard Deviation", "0.222"},
|
||||
{"Annual Variance", "0.049"},
|
||||
{"Information Ratio", "-14.565"},
|
||||
{"Tracking Error", "0.001"},
|
||||
{"Treynor Ratio", "1.922"},
|
||||
{"Total Fees", "$3.26"},
|
||||
{"Estimated Strategy Capacity", "$58000000.00"},
|
||||
{"Treynor Ratio", "1.978"},
|
||||
{"Total Fees", "$3.44"},
|
||||
{"Estimated Strategy Capacity", "$56000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.248"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "93.761"},
|
||||
{"Return Over Maximum Drawdown", "93.728"},
|
||||
{"Portfolio Turnover", "0.248"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
@@ -117,7 +118,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "25885f979ca8c7b44f5d0f7daf00b241"}
|
||||
{"OrderListHash", "9e4bfd2eb0b81ee5bc1b197a87ccedbe"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,6 +224,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$85.34"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", "BTCEUR XJ"},
|
||||
{"Fitness Score", "0.5"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
|
||||
@@ -71,30 +71,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Trades", "1"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "246.000%"},
|
||||
{"Drawdown", "1.100%"},
|
||||
{"Compounding Annual Return", "246.546%"},
|
||||
{"Drawdown", "1.200%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "3.459%"},
|
||||
{"Sharpe Ratio", "10.11"},
|
||||
{"Probabilistic Sharpe Ratio", "83.150%"},
|
||||
{"Net Profit", "3.464%"},
|
||||
{"Sharpe Ratio", "9.933"},
|
||||
{"Probabilistic Sharpe Ratio", "82.470%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "1.935"},
|
||||
{"Beta", "-0.119"},
|
||||
{"Annual Standard Deviation", "0.16"},
|
||||
{"Annual Variance", "0.026"},
|
||||
{"Information Ratio", "-4.556"},
|
||||
{"Tracking Error", "0.221"},
|
||||
{"Treynor Ratio", "-13.568"},
|
||||
{"Total Fees", "$3.26"},
|
||||
{"Estimated Strategy Capacity", "$890000000.00"},
|
||||
{"Fitness Score", "0.111"},
|
||||
{"Alpha", "1.957"},
|
||||
{"Beta", "-0.125"},
|
||||
{"Annual Standard Deviation", "0.164"},
|
||||
{"Annual Variance", "0.027"},
|
||||
{"Information Ratio", "-4.577"},
|
||||
{"Tracking Error", "0.225"},
|
||||
{"Treynor Ratio", "-13.006"},
|
||||
{"Total Fees", "$3.45"},
|
||||
{"Estimated Strategy Capacity", "$970000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.112"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "52.533"},
|
||||
{"Return Over Maximum Drawdown", "214.75"},
|
||||
{"Portfolio Turnover", "0.111"},
|
||||
{"Sortino Ratio", "53.951"},
|
||||
{"Return Over Maximum Drawdown", "209.464"},
|
||||
{"Portfolio Turnover", "0.112"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
@@ -108,7 +109,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "82fee25cd17100c53bb173834ab5f0b2"}
|
||||
{"OrderListHash", "33d01821923c397f999cfb2e5b5928ad"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,29 +92,30 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Trades", "3"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "-1.01%"},
|
||||
{"Compounding Annual Return", "254.782%"},
|
||||
{"Compounding Annual Return", "261.134%"},
|
||||
{"Drawdown", "2.200%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "1.632%"},
|
||||
{"Sharpe Ratio", "8.371"},
|
||||
{"Probabilistic Sharpe Ratio", "66.555%"},
|
||||
{"Net Profit", "1.655%"},
|
||||
{"Sharpe Ratio", "8.505"},
|
||||
{"Probabilistic Sharpe Ratio", "66.840%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "-0.088"},
|
||||
{"Alpha", "-0.091"},
|
||||
{"Beta", "1.006"},
|
||||
{"Annual Standard Deviation", "0.221"},
|
||||
{"Annual Variance", "0.049"},
|
||||
{"Information Ratio", "-32.586"},
|
||||
{"Annual Standard Deviation", "0.224"},
|
||||
{"Annual Variance", "0.05"},
|
||||
{"Information Ratio", "-33.445"},
|
||||
{"Tracking Error", "0.002"},
|
||||
{"Treynor Ratio", "1.839"},
|
||||
{"Total Fees", "$9.77"},
|
||||
{"Treynor Ratio", "1.893"},
|
||||
{"Total Fees", "$10.32"},
|
||||
{"Estimated Strategy Capacity", "$27000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.747"},
|
||||
{"Kelly Criterion Estimate", "38.64"},
|
||||
{"Kelly Criterion Probability Value", "0.229"},
|
||||
{"Kelly Criterion Estimate", "38.796"},
|
||||
{"Kelly Criterion Probability Value", "0.228"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "85.209"},
|
||||
{"Return Over Maximum Drawdown", "85.095"},
|
||||
{"Portfolio Turnover", "0.747"},
|
||||
{"Total Insights Generated", "100"},
|
||||
{"Total Insights Closed", "99"},
|
||||
@@ -122,14 +123,14 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Long Insight Count", "100"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$126657.6305"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$20405.9516"},
|
||||
{"Mean Population Estimated Insight Value", "$206.1207"},
|
||||
{"Mean Population Direction", "54.5455%"},
|
||||
{"Mean Population Magnitude", "54.5455%"},
|
||||
{"Rolling Averaged Population Direction", "59.8056%"},
|
||||
{"Rolling Averaged Population Magnitude", "59.8056%"},
|
||||
{"OrderListHash", "17e29d58e5dabd93569da752c4552c70"}
|
||||
{"Estimated Monthly Alpha Value", "$135639.1761"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$21852.9784"},
|
||||
{"Mean Population Estimated Insight Value", "$220.7372"},
|
||||
{"Mean Population Direction", "53.5354%"},
|
||||
{"Mean Population Magnitude", "53.5354%"},
|
||||
{"Rolling Averaged Population Direction", "58.2788%"},
|
||||
{"Rolling Averaged Population Magnitude", "58.2788%"},
|
||||
{"OrderListHash", "ad2216297c759d8e5aef48ff065f8919"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,15 +139,16 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Loss Rate", "89%"},
|
||||
{"Win Rate", "11%"},
|
||||
{"Profit-Loss Ratio", "0.69"},
|
||||
{"Alpha", "4.398"},
|
||||
{"Beta", "-0.989"},
|
||||
{"Alpha", "4.469"},
|
||||
{"Beta", "-0.961"},
|
||||
{"Annual Standard Deviation", "0.373"},
|
||||
{"Annual Variance", "0.139"},
|
||||
{"Information Ratio", "-12.816"},
|
||||
{"Tracking Error", "0.504"},
|
||||
{"Treynor Ratio", "1.011"},
|
||||
{"Information Ratio", "-13.191"},
|
||||
{"Tracking Error", "0.507"},
|
||||
{"Treynor Ratio", "1.04"},
|
||||
{"Total Fees", "$15207.00"},
|
||||
{"Estimated Strategy Capacity", "$7700.00"},
|
||||
{"Estimated Strategy Capacity", "$8000.00"},
|
||||
{"Lowest Capacity Asset", "GC VOFJUCDY9XNH"},
|
||||
{"Fitness Score", "0.033"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
|
||||
@@ -147,15 +147,16 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "-1.347"},
|
||||
{"Alpha", "-1.362"},
|
||||
{"Beta", "0.257"},
|
||||
{"Annual Standard Deviation", "0.109"},
|
||||
{"Annual Variance", "0.012"},
|
||||
{"Information Ratio", "-14.763"},
|
||||
{"Tracking Error", "0.188"},
|
||||
{"Treynor Ratio", "-3.318"},
|
||||
{"Information Ratio", "-14.947"},
|
||||
{"Tracking Error", "0.19"},
|
||||
{"Treynor Ratio", "-3.309"},
|
||||
{"Total Fees", "$3.70"},
|
||||
{"Estimated Strategy Capacity", "$52000000.00"},
|
||||
{"Lowest Capacity Asset", "GC VL5E74HP3EE5"},
|
||||
{"Fitness Score", "0.009"},
|
||||
{"Kelly Criterion Estimate", "-112.972"},
|
||||
{"Kelly Criterion Probability Value", "0.671"},
|
||||
|
||||
@@ -161,6 +161,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", ""},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
|
||||
@@ -123,15 +123,16 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "0"},
|
||||
{"Beta", "0"},
|
||||
{"Alpha", "-0.908"},
|
||||
{"Beta", "0.468"},
|
||||
{"Annual Standard Deviation", "0.139"},
|
||||
{"Annual Variance", "0.019"},
|
||||
{"Information Ratio", "-4.217"},
|
||||
{"Tracking Error", "0.139"},
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Information Ratio", "-9.003"},
|
||||
{"Tracking Error", "0.142"},
|
||||
{"Treynor Ratio", "-1.251"},
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$14000000.00"},
|
||||
{"Lowest Capacity Asset", "SPX XL80P3GHDZXQ|SPX 31"},
|
||||
{"Fitness Score", "0.044"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
|
||||
139
Algorithm.CSharp/BasicTemplateIndiaAlgorithm.cs
Normal file
139
Algorithm.CSharp/BasicTemplateIndiaAlgorithm.cs
Normal file
@@ -0,0 +1,139 @@
|
||||
/*
|
||||
* 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.Algorithm.Framework.Alphas;
|
||||
using QuantConnect.Algorithm.Framework.Execution;
|
||||
using QuantConnect.Algorithm.Framework.Portfolio;
|
||||
using QuantConnect.Algorithm.Framework.Risk;
|
||||
using QuantConnect.Algorithm.Framework.Selection;
|
||||
using QuantConnect.Orders;
|
||||
using QuantConnect.Interfaces;
|
||||
using QuantConnect.Data;
|
||||
|
||||
namespace QuantConnect.Algorithm.CSharp
|
||||
{
|
||||
/// <summary>
|
||||
/// Basic template India algorithm simply initializes the date range and cash. This is a skeleton
|
||||
/// framework you can use for designing an algorithm.
|
||||
/// </summary>
|
||||
/// <meta name="tag" content="using data" />
|
||||
/// <meta name="tag" content="using quantconnect" />
|
||||
/// <meta name="tag" content="trading and orders" />
|
||||
public class BasicTemplateIndiaAlgorithm : QCAlgorithm
|
||||
{
|
||||
/// <summary>
|
||||
/// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.
|
||||
/// </summary>
|
||||
public override void Initialize()
|
||||
{
|
||||
SetStartDate(2003, 10, 07); //Set Start Date
|
||||
SetEndDate(2003, 10, 11); //Set End Date
|
||||
SetCash(100000); //Set Strategy Cash
|
||||
|
||||
// Find more symbols here: http://quantconnect.com/data
|
||||
// Equities Resolutions: Tick, Second, Minute, Hour, Daily.
|
||||
AddEquity("TCS", Resolution.Tick, Market.India);
|
||||
|
||||
//Set Order Prperties as per the requirements for order placement
|
||||
DefaultOrderProperties = new ZerodhaOrderProperties(exchange: "nse");
|
||||
|
||||
// General Debug statement for acknowledgement
|
||||
Debug("Intialization Done");
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
|
||||
/// </summary>
|
||||
/// <param name="data">Slice object keyed by symbol containing the stock data</param>
|
||||
public override void OnData(Slice data)
|
||||
{
|
||||
if (!Portfolio.Invested)
|
||||
{
|
||||
var marketTicket = MarketOrder("TCS", 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override void OnOrderEvent(OrderEvent orderEvent)
|
||||
{
|
||||
if (orderEvent.Status.IsFill())
|
||||
{
|
||||
Debug($"Purchased Complete: {orderEvent.Symbol}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <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; } = false;
|
||||
|
||||
/// <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>
|
||||
/// This is used by the regression test system to indicate what the expected statistics are from running the algorithm
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "3"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "-1.01%"},
|
||||
{"Compounding Annual Return", "261.134%"},
|
||||
{"Drawdown", "2.200%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "1.655%"},
|
||||
{"Sharpe Ratio", "8.505"},
|
||||
{"Probabilistic Sharpe Ratio", "66.840%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "-0.091"},
|
||||
{"Beta", "1.006"},
|
||||
{"Annual Standard Deviation", "0.224"},
|
||||
{"Annual Variance", "0.05"},
|
||||
{"Information Ratio", "-33.445"},
|
||||
{"Tracking Error", "0.002"},
|
||||
{"Treynor Ratio", "1.893"},
|
||||
{"Total Fees", "$10.32"},
|
||||
{"Estimated Strategy Capacity", "$27000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.747"},
|
||||
{"Kelly Criterion Estimate", "38.796"},
|
||||
{"Kelly Criterion Probability Value", "0.228"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "85.095"},
|
||||
{"Portfolio Turnover", "0.747"},
|
||||
{"Total Insights Generated", "100"},
|
||||
{"Total Insights Closed", "99"},
|
||||
{"Total Insights Analysis Completed", "99"},
|
||||
{"Long Insight Count", "100"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$135639.1761"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$21852.9784"},
|
||||
{"Mean Population Estimated Insight Value", "$220.7372"},
|
||||
{"Mean Population Direction", "53.5354%"},
|
||||
{"Mean Population Magnitude", "53.5354%"},
|
||||
{"Rolling Averaged Population Direction", "58.2788%"},
|
||||
{"Rolling Averaged Population Magnitude", "58.2788%"},
|
||||
{"OrderListHash", "ad2216297c759d8e5aef48ff065f8919"}
|
||||
};
|
||||
}
|
||||
}
|
||||
151
Algorithm.CSharp/BasicTemplateOptionEquityStrategyAlgorithm.cs
Normal file
151
Algorithm.CSharp/BasicTemplateOptionEquityStrategyAlgorithm.cs
Normal file
@@ -0,0 +1,151 @@
|
||||
/*
|
||||
* 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.Linq;
|
||||
using QuantConnect.Data;
|
||||
using QuantConnect.Orders;
|
||||
using QuantConnect.Interfaces;
|
||||
using QuantConnect.Data.Market;
|
||||
using System.Collections.Generic;
|
||||
using QuantConnect.Securities.Option;
|
||||
|
||||
namespace QuantConnect.Algorithm.CSharp
|
||||
{
|
||||
/// <summary>
|
||||
/// Basic template algorithm trading a Call Butterfly option equity strategy
|
||||
/// </summary>
|
||||
/// <meta name="tag" content="options" />
|
||||
/// <meta name="tag" content="using data" />
|
||||
/// <meta name="tag" content="using quantconnect" />
|
||||
/// <meta name="tag" content="trading and orders" />
|
||||
public class BasicTemplateOptionEquityStrategyAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition
|
||||
{
|
||||
protected Symbol _optionSymbol;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
SetStartDate(2015, 12, 24);
|
||||
SetEndDate(2015, 12, 24);
|
||||
|
||||
var equity = AddEquity("GOOG", leverage: 4);
|
||||
var option = AddOption(equity.Symbol);
|
||||
_optionSymbol = option.Symbol;
|
||||
|
||||
// set our strike/expiry filter for this option chain
|
||||
option.SetFilter(u => u.Strikes(-2, +2)
|
||||
// Expiration method accepts TimeSpan objects or integer for days.
|
||||
// The following statements yield the same filtering criteria
|
||||
.Expiration(0, 180));
|
||||
}
|
||||
/// <summary>
|
||||
/// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
|
||||
/// </summary>
|
||||
/// <param name="slice">Slice object keyed by symbol containing the stock data</param>
|
||||
public override void OnData(Slice slice)
|
||||
{
|
||||
if (!Portfolio.Invested)
|
||||
{
|
||||
OptionChain chain;
|
||||
if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))
|
||||
{
|
||||
var callContracts = chain.Where(contract => contract.Right == OptionRight.Call)
|
||||
.GroupBy(x => x.Expiry)
|
||||
.OrderBy(grouping => grouping.Key)
|
||||
.First()
|
||||
.OrderBy(x => x.Strike)
|
||||
.ToList();
|
||||
|
||||
var expiry = callContracts[0].Expiry;
|
||||
var lowerStrike = callContracts[0].Strike;
|
||||
var middleStrike = callContracts[1].Strike;
|
||||
var higherStrike = callContracts[2].Strike;
|
||||
|
||||
var optionStrategy = OptionStrategies.CallButterfly(_optionSymbol, higherStrike, middleStrike, lowerStrike, expiry);
|
||||
|
||||
Order(optionStrategy, 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Order fill event handler. On an order fill update the resulting information is passed to this method.
|
||||
/// </summary>
|
||||
/// <param name="orderEvent">Order event details containing details of the evemts</param>
|
||||
/// <remarks>This method can be called asynchronously and so should only be used by seasoned C# experts. Ensure you use proper locks on thread-unsafe objects</remarks>
|
||||
public override void OnOrderEvent(OrderEvent orderEvent)
|
||||
{
|
||||
Log($"{orderEvent}");
|
||||
}
|
||||
|
||||
/// <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 => 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>
|
||||
/// This is used by the regression test system to indicate what the expected statistics are from running the algorithm
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "3"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
{"Drawdown", "0%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "0"},
|
||||
{"Beta", "0"},
|
||||
{"Annual Standard Deviation", "0"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "0"},
|
||||
{"Tracking Error", "0"},
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$10.00"},
|
||||
{"Estimated Strategy Capacity", "$84000.00"},
|
||||
{"Lowest Capacity Asset", "GOOCV W78ZERHAOVVQ|GOOCV VP83T1ZUHROL"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "0"},
|
||||
{"Return Over Maximum Drawdown", "0"},
|
||||
{"Portfolio Turnover", "0"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "82c29cc9db9a300074d6ff136253f4ac"}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -134,7 +134,8 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Tracking Error", "0"},
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$778.00"},
|
||||
{"Estimated Strategy Capacity", "$720.00"},
|
||||
{"Estimated Strategy Capacity", "$1000.00"},
|
||||
{"Lowest Capacity Asset", "GOOCV W78ZFMEBBB2E|GOOCV VP83T1ZUHROL"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
@@ -154,7 +155,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "5484aef1443064c826e0071f757cb0f7"}
|
||||
{"OrderListHash", "6a88f302b7f29a2c59e4b1e978161da1"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,6 +132,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$2.00"},
|
||||
{"Estimated Strategy Capacity", "$1300000.00"},
|
||||
{"Lowest Capacity Asset", "GOOCV 30AKMEIPOSS1Y|GOOCV VP83T1ZUHROL"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
|
||||
@@ -123,6 +123,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$1.00"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", "GOOCV VP83T1ZUHROL"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
|
||||
@@ -162,6 +162,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$3.00"},
|
||||
{"Estimated Strategy Capacity", "$74000.00"},
|
||||
{"Lowest Capacity Asset", "AAPL 2ZQGWTSSZ0WLI|AAPL R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0.327"},
|
||||
{"Kelly Criterion Probability Value", "1"},
|
||||
|
||||
@@ -74,47 +74,48 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "18"},
|
||||
{"Total Trades", "17"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "-0.16%"},
|
||||
{"Compounding Annual Return", "72.164%"},
|
||||
{"Average Loss", "-0.17%"},
|
||||
{"Compounding Annual Return", "62.842%"},
|
||||
{"Drawdown", "1.100%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "0.747%"},
|
||||
{"Sharpe Ratio", "4.086"},
|
||||
{"Probabilistic Sharpe Ratio", "61.091%"},
|
||||
{"Net Profit", "0.670%"},
|
||||
{"Sharpe Ratio", "3.525"},
|
||||
{"Probabilistic Sharpe Ratio", "59.239%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "-0.305"},
|
||||
{"Beta", "0.564"},
|
||||
{"Annual Standard Deviation", "0.113"},
|
||||
{"Alpha", "-0.382"},
|
||||
{"Beta", "0.565"},
|
||||
{"Annual Standard Deviation", "0.116"},
|
||||
{"Annual Variance", "0.013"},
|
||||
{"Information Ratio", "-10.007"},
|
||||
{"Tracking Error", "0.09"},
|
||||
{"Treynor Ratio", "0.82"},
|
||||
{"Total Fees", "$41.70"},
|
||||
{"Estimated Strategy Capacity", "$3000000.00"},
|
||||
{"Fitness Score", "0.634"},
|
||||
{"Kelly Criterion Estimate", "13.656"},
|
||||
{"Kelly Criterion Probability Value", "0.228"},
|
||||
{"Information Ratio", "-10.772"},
|
||||
{"Tracking Error", "0.092"},
|
||||
{"Treynor Ratio", "0.722"},
|
||||
{"Total Fees", "$43.20"},
|
||||
{"Estimated Strategy Capacity", "$3200000.00"},
|
||||
{"Lowest Capacity Asset", "AIG R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.644"},
|
||||
{"Kelly Criterion Estimate", "13.787"},
|
||||
{"Kelly Criterion Probability Value", "0.231"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "80.05"},
|
||||
{"Portfolio Turnover", "0.634"},
|
||||
{"Total Insights Generated", "17"},
|
||||
{"Total Insights Closed", "14"},
|
||||
{"Total Insights Analysis Completed", "14"},
|
||||
{"Return Over Maximum Drawdown", "66.069"},
|
||||
{"Portfolio Turnover", "0.645"},
|
||||
{"Total Insights Generated", "13"},
|
||||
{"Total Insights Closed", "10"},
|
||||
{"Total Insights Analysis Completed", "10"},
|
||||
{"Long Insight Count", "6"},
|
||||
{"Short Insight Count", "7"},
|
||||
{"Long/Short Ratio", "85.71%"},
|
||||
{"Estimated Monthly Alpha Value", "$72447.6813"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$12477.1007"},
|
||||
{"Mean Population Estimated Insight Value", "$891.2215"},
|
||||
{"Mean Population Direction", "50%"},
|
||||
{"Mean Population Magnitude", "50%"},
|
||||
{"Rolling Averaged Population Direction", "12.6429%"},
|
||||
{"Rolling Averaged Population Magnitude", "12.6429%"},
|
||||
{"OrderListHash", "3edd51956c7c97af4863aa6059c11f1a"}
|
||||
{"Estimated Monthly Alpha Value", "$52003.0716"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$8956.0846"},
|
||||
{"Mean Population Estimated Insight Value", "$895.6085"},
|
||||
{"Mean Population Direction", "70%"},
|
||||
{"Mean Population Magnitude", "70%"},
|
||||
{"Rolling Averaged Population Direction", "94.5154%"},
|
||||
{"Rolling Averaged Population Magnitude", "94.5154%"},
|
||||
{"OrderListHash", "3d0949901dfba45209ed339866d4f4f1"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,11 +151,12 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Beta", "0"},
|
||||
{"Annual Standard Deviation", "0"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-7.067"},
|
||||
{"Tracking Error", "0.193"},
|
||||
{"Treynor Ratio", "7.887"},
|
||||
{"Information Ratio", "-7.163"},
|
||||
{"Tracking Error", "0.195"},
|
||||
{"Treynor Ratio", "8.093"},
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", "VIX.IncrementallyGeneratedCustomData 2S"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
|
||||
@@ -148,6 +148,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$370000.00"},
|
||||
{"Lowest Capacity Asset", "ETHUSD XJ"},
|
||||
{"Fitness Score", "0.501"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
|
||||
@@ -81,8 +81,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
algorithm.DateRules.MonthStart(benchmark.Symbol),
|
||||
algorithm.TimeRules.AfterMarketOpen(benchmark.Symbol),
|
||||
datetime => SelectPair(algorithm, datetime),
|
||||
algorithm.UniverseSettings,
|
||||
algorithm.SecurityInitializer);
|
||||
algorithm.UniverseSettings);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -75,33 +75,34 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "167"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "0%"},
|
||||
{"Drawdown", "0%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Total Trades", "251"},
|
||||
{"Average Win", "0.01%"},
|
||||
{"Average Loss", "-0.01%"},
|
||||
{"Compounding Annual Return", "-37.465%"},
|
||||
{"Drawdown", "0.300%"},
|
||||
{"Expectancy", "-0.285"},
|
||||
{"Net Profit", "-0.257%"},
|
||||
{"Sharpe Ratio", "-40.568"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Loss Rate", "66%"},
|
||||
{"Win Rate", "34%"},
|
||||
{"Profit-Loss Ratio", "1.08"},
|
||||
{"Alpha", "0"},
|
||||
{"Beta", "0"},
|
||||
{"Annual Standard Deviation", "0"},
|
||||
{"Annual Standard Deviation", "0.006"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "0"},
|
||||
{"Tracking Error", "0"},
|
||||
{"Information Ratio", "-40.568"},
|
||||
{"Tracking Error", "0.006"},
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Fitness Score", "0.5"},
|
||||
{"Estimated Strategy Capacity", "$660000.00"},
|
||||
{"Lowest Capacity Asset", "DE30EUR 8I"},
|
||||
{"Fitness Score", "0.002"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "-325.922"},
|
||||
{"Portfolio Turnover", "9.561"},
|
||||
{"Sortino Ratio", "-23.868"},
|
||||
{"Return Over Maximum Drawdown", "-170.818"},
|
||||
{"Portfolio Turnover", "12.673"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
@@ -115,7 +116,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "6ea6184a2a8d0d69e552ad866933bfb6"}
|
||||
{"OrderListHash", "6745cf313aa3ef780d052ca3ba933c6c"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,29 +164,30 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Trades", "2"},
|
||||
{"Average Win", "1.16%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "32.515%"},
|
||||
{"Compounding Annual Return", "32.505%"},
|
||||
{"Drawdown", "1.400%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "1.164%"},
|
||||
{"Sharpe Ratio", "2.857"},
|
||||
{"Probabilistic Sharpe Ratio", "64.822%"},
|
||||
{"Net Profit", "1.163%"},
|
||||
{"Sharpe Ratio", "2.876"},
|
||||
{"Probabilistic Sharpe Ratio", "64.984%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "100%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "0.237"},
|
||||
{"Beta", "-0.182"},
|
||||
{"Annual Standard Deviation", "0.09"},
|
||||
{"Beta", "-0.188"},
|
||||
{"Annual Standard Deviation", "0.089"},
|
||||
{"Annual Variance", "0.008"},
|
||||
{"Information Ratio", "2.425"},
|
||||
{"Tracking Error", "0.149"},
|
||||
{"Treynor Ratio", "-1.405"},
|
||||
{"Information Ratio", "2.409"},
|
||||
{"Tracking Error", "0.148"},
|
||||
{"Treynor Ratio", "-1.358"},
|
||||
{"Total Fees", "$2.00"},
|
||||
{"Estimated Strategy Capacity", "$42000000.00"},
|
||||
{"Estimated Strategy Capacity", "$49000000.00"},
|
||||
{"Lowest Capacity Asset", "IBM R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.076"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "27.329"},
|
||||
{"Return Over Maximum Drawdown", "24.003"},
|
||||
{"Sortino Ratio", "27.328"},
|
||||
{"Return Over Maximum Drawdown", "24.002"},
|
||||
{"Portfolio Turnover", "0.076"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
@@ -201,7 +202,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "edd9e9ffc8a1cdfb7a1e6ae601e61b12"}
|
||||
{"OrderListHash", "159887a90516df8ba8e8d35b9c30b227"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,30 +147,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Trades", "13"},
|
||||
{"Average Win", "0.65%"},
|
||||
{"Average Loss", "-0.05%"},
|
||||
{"Compounding Annual Return", "3216040423556140000000000%"},
|
||||
{"Compounding Annual Return", "79228162514264337593543950335%"},
|
||||
{"Drawdown", "0.500%"},
|
||||
{"Expectancy", "1.393"},
|
||||
{"Net Profit", "32.840%"},
|
||||
{"Sharpe Ratio", "7.14272222483913E+15"},
|
||||
{"Net Profit", "149.699%"},
|
||||
{"Sharpe Ratio", "4.743312616499238E+27"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "83%"},
|
||||
{"Win Rate", "17%"},
|
||||
{"Profit-Loss Ratio", "13.36"},
|
||||
{"Alpha", "2.59468989671647E+16"},
|
||||
{"Beta", "67.661"},
|
||||
{"Annual Standard Deviation", "3.633"},
|
||||
{"Annual Variance", "13.196"},
|
||||
{"Information Ratio", "7.24987266907741E+15"},
|
||||
{"Tracking Error", "3.579"},
|
||||
{"Treynor Ratio", "383485597312030"},
|
||||
{"Total Fees", "$13.00"},
|
||||
{"Alpha", "7.922816251426434E+28"},
|
||||
{"Beta", "304.581"},
|
||||
{"Annual Standard Deviation", "16.703"},
|
||||
{"Annual Variance", "278.995"},
|
||||
{"Information Ratio", "4.75893717482582E+27"},
|
||||
{"Tracking Error", "16.648"},
|
||||
{"Treynor Ratio", "2.6012216611301735E+26"},
|
||||
{"Total Fees", "$13.20"},
|
||||
{"Estimated Strategy Capacity", "$3000000.00"},
|
||||
{"Fitness Score", "0.232"},
|
||||
{"Lowest Capacity Asset", "AOL VRKS95ENLBYE|AOL R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.18"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "79228162514264337593543950335"},
|
||||
{"Portfolio Turnover", "0.232"},
|
||||
{"Portfolio Turnover", "0.18"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
@@ -184,7 +185,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "12470afd9a74ad9c9802361f6f092777"}
|
||||
{"OrderListHash", "2a6319d0d474f976e653dd1ebc42caac"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,33 +116,34 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "11"},
|
||||
{"Average Win", "0.51%"},
|
||||
{"Average Loss", "-0.33%"},
|
||||
{"Compounding Annual Return", "-31.082%"},
|
||||
{"Drawdown", "2.700%"},
|
||||
{"Expectancy", "0.263"},
|
||||
{"Net Profit", "-1.518%"},
|
||||
{"Sharpe Ratio", "-2.118"},
|
||||
{"Probabilistic Sharpe Ratio", "23.259%"},
|
||||
{"Loss Rate", "50%"},
|
||||
{"Win Rate", "50%"},
|
||||
{"Profit-Loss Ratio", "1.53"},
|
||||
{"Alpha", "-0.208"},
|
||||
{"Beta", "0.415"},
|
||||
{"Annual Standard Deviation", "0.119"},
|
||||
{"Annual Variance", "0.014"},
|
||||
{"Information Ratio", "-1.167"},
|
||||
{"Total Trades", "12"},
|
||||
{"Average Win", "0.55%"},
|
||||
{"Average Loss", "-0.26%"},
|
||||
{"Compounding Annual Return", "16.717%"},
|
||||
{"Drawdown", "1.700%"},
|
||||
{"Expectancy", "0.850"},
|
||||
{"Net Profit", "0.637%"},
|
||||
{"Sharpe Ratio", "1.131"},
|
||||
{"Probabilistic Sharpe Ratio", "50.538%"},
|
||||
{"Loss Rate", "40%"},
|
||||
{"Win Rate", "60%"},
|
||||
{"Profit-Loss Ratio", "2.08"},
|
||||
{"Alpha", "0.186"},
|
||||
{"Beta", "0.465"},
|
||||
{"Annual Standard Deviation", "0.123"},
|
||||
{"Annual Variance", "0.015"},
|
||||
{"Information Ratio", "1.908"},
|
||||
{"Tracking Error", "0.126"},
|
||||
{"Treynor Ratio", "-0.607"},
|
||||
{"Total Fees", "$11.63"},
|
||||
{"Estimated Strategy Capacity", "$46000000.00"},
|
||||
{"Fitness Score", "0.013"},
|
||||
{"Treynor Ratio", "0.299"},
|
||||
{"Total Fees", "$27.94"},
|
||||
{"Estimated Strategy Capacity", "$200000000.00"},
|
||||
{"Lowest Capacity Asset", "AAPL R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.28"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "-5.1"},
|
||||
{"Return Over Maximum Drawdown", "-11.717"},
|
||||
{"Portfolio Turnover", "0.282"},
|
||||
{"Sortino Ratio", "3"},
|
||||
{"Return Over Maximum Drawdown", "9.559"},
|
||||
{"Portfolio Turnover", "0.308"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
@@ -156,7 +157,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "3d1ae61492b34c39115b76757510c058"}
|
||||
{"OrderListHash", "de456413f89396bd6f920686219ed0a5"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,11 +110,12 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Beta", "0"},
|
||||
{"Annual Standard Deviation", "0"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-1.383"},
|
||||
{"Information Ratio", "-1.388"},
|
||||
{"Tracking Error", "0.096"},
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", ""},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
|
||||
@@ -103,29 +103,30 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Trades", "1"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "58.336%"},
|
||||
{"Drawdown", "0.900%"},
|
||||
{"Compounding Annual Return", "57.657%"},
|
||||
{"Drawdown", "1.000%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "1.012%"},
|
||||
{"Sharpe Ratio", "5.09"},
|
||||
{"Probabilistic Sharpe Ratio", "68.472%"},
|
||||
{"Net Profit", "1.003%"},
|
||||
{"Sharpe Ratio", "5.024"},
|
||||
{"Probabilistic Sharpe Ratio", "68.421%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "0.322"},
|
||||
{"Beta", "0.265"},
|
||||
{"Alpha", "0.312"},
|
||||
{"Beta", "0.27"},
|
||||
{"Annual Standard Deviation", "0.087"},
|
||||
{"Annual Variance", "0.008"},
|
||||
{"Information Ratio", "-0.088"},
|
||||
{"Information Ratio", "-0.242"},
|
||||
{"Tracking Error", "0.105"},
|
||||
{"Treynor Ratio", "1.667"},
|
||||
{"Total Fees", "$2.91"},
|
||||
{"Estimated Strategy Capacity", "$670000000.00"},
|
||||
{"Treynor Ratio", "1.616"},
|
||||
{"Total Fees", "$3.08"},
|
||||
{"Estimated Strategy Capacity", "$720000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.141"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "9.731"},
|
||||
{"Return Over Maximum Drawdown", "61.515"},
|
||||
{"Sortino Ratio", "10.385"},
|
||||
{"Return Over Maximum Drawdown", "58.709"},
|
||||
{"Portfolio Turnover", "0.143"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
@@ -140,7 +141,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "718d73fbddccb63aeacbf4659938b4b8"}
|
||||
{"OrderListHash", "50145c3c1d58b09f38ec1b77cfe69eae"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
|
||||
UniverseSettings.FillForward = false;
|
||||
|
||||
AddUniverse(new CustomDataCoarseFundamentalUniverse(UniverseSettings, SecurityInitializer, CoarseSelectionFunction));
|
||||
AddUniverse(new CustomDataCoarseFundamentalUniverse(UniverseSettings, CoarseSelectionFunction));
|
||||
|
||||
_symbols = new List<Symbol>();
|
||||
}
|
||||
@@ -93,8 +93,8 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
|
||||
private class CustomDataCoarseFundamentalUniverse : CoarseFundamentalUniverse
|
||||
{
|
||||
public CustomDataCoarseFundamentalUniverse(UniverseSettings universeSettings, ISecurityInitializer securityInitializer, Func<IEnumerable<CoarseFundamental>, IEnumerable<Symbol>> selector)
|
||||
: base(universeSettings, securityInitializer, selector)
|
||||
public CustomDataCoarseFundamentalUniverse(UniverseSettings universeSettings, Func<IEnumerable<CoarseFundamental>, IEnumerable<Symbol>> selector)
|
||||
: base(universeSettings, selector)
|
||||
{ }
|
||||
|
||||
public override IEnumerable<SubscriptionRequest> GetSubscriptionRequests(Security security, DateTime currentTimeUtc, DateTime maximumEndTimeUtc,
|
||||
|
||||
@@ -74,29 +74,30 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Trades", "7"},
|
||||
{"Average Win", "0.01%"},
|
||||
{"Average Loss", "-0.40%"},
|
||||
{"Compounding Annual Return", "1114.772%"},
|
||||
{"Compounding Annual Return", "1143.086%"},
|
||||
{"Drawdown", "1.800%"},
|
||||
{"Expectancy", "-0.319"},
|
||||
{"Net Profit", "3.244%"},
|
||||
{"Sharpe Ratio", "23.478"},
|
||||
{"Probabilistic Sharpe Ratio", "80.383%"},
|
||||
{"Net Profit", "3.275%"},
|
||||
{"Sharpe Ratio", "23.495"},
|
||||
{"Probabilistic Sharpe Ratio", "80.494%"},
|
||||
{"Loss Rate", "33%"},
|
||||
{"Win Rate", "67%"},
|
||||
{"Profit-Loss Ratio", "0.02"},
|
||||
{"Alpha", "4.314"},
|
||||
{"Beta", "1.239"},
|
||||
{"Annual Standard Deviation", "0.285"},
|
||||
{"Annual Variance", "0.081"},
|
||||
{"Information Ratio", "47.452"},
|
||||
{"Tracking Error", "0.101"},
|
||||
{"Treynor Ratio", "5.409"},
|
||||
{"Total Fees", "$67.00"},
|
||||
{"Estimated Strategy Capacity", "$3200000.00"},
|
||||
{"Alpha", "4.366"},
|
||||
{"Beta", "1.255"},
|
||||
{"Annual Standard Deviation", "0.292"},
|
||||
{"Annual Variance", "0.085"},
|
||||
{"Information Ratio", "47.955"},
|
||||
{"Tracking Error", "0.102"},
|
||||
{"Treynor Ratio", "5.461"},
|
||||
{"Total Fees", "$71.37"},
|
||||
{"Estimated Strategy Capacity", "$3500000.00"},
|
||||
{"Lowest Capacity Asset", "AIG R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.501"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "148.636"},
|
||||
{"Return Over Maximum Drawdown", "1502.912"},
|
||||
{"Sortino Ratio", "148.07"},
|
||||
{"Return Over Maximum Drawdown", "1487.238"},
|
||||
{"Portfolio Turnover", "0.501"},
|
||||
{"Total Insights Generated", "2"},
|
||||
{"Total Insights Closed", "0"},
|
||||
@@ -111,7 +112,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "ba44309886ea8ff515ef593a24456c47"}
|
||||
{"OrderListHash", "5a171f804d47cd27f84aaef791da8594"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,31 +66,32 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "7"},
|
||||
{"Average Win", "1.02%"},
|
||||
{"Average Win", "1.01%"},
|
||||
{"Average Loss", "-1.01%"},
|
||||
{"Compounding Annual Return", "205.606%"},
|
||||
{"Compounding Annual Return", "210.936%"},
|
||||
{"Drawdown", "2.200%"},
|
||||
{"Expectancy", "0.339"},
|
||||
{"Net Profit", "1.439%"},
|
||||
{"Sharpe Ratio", "7.166"},
|
||||
{"Probabilistic Sharpe Ratio", "64.794%"},
|
||||
{"Net Profit", "1.461%"},
|
||||
{"Sharpe Ratio", "7.289"},
|
||||
{"Probabilistic Sharpe Ratio", "65.077%"},
|
||||
{"Loss Rate", "33%"},
|
||||
{"Win Rate", "67%"},
|
||||
{"Profit-Loss Ratio", "1.01"},
|
||||
{"Alpha", "-0.341"},
|
||||
{"Alpha", "-0.349"},
|
||||
{"Beta", "0.968"},
|
||||
{"Annual Standard Deviation", "0.213"},
|
||||
{"Annual Variance", "0.045"},
|
||||
{"Information Ratio", "-46.719"},
|
||||
{"Annual Standard Deviation", "0.216"},
|
||||
{"Annual Variance", "0.046"},
|
||||
{"Information Ratio", "-47.59"},
|
||||
{"Tracking Error", "0.009"},
|
||||
{"Treynor Ratio", "1.575"},
|
||||
{"Total Fees", "$22.77"},
|
||||
{"Estimated Strategy Capacity", "$22000000.00"},
|
||||
{"Treynor Ratio", "1.623"},
|
||||
{"Total Fees", "$24.07"},
|
||||
{"Estimated Strategy Capacity", "$23000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.999"},
|
||||
{"Kelly Criterion Estimate", "38.64"},
|
||||
{"Kelly Criterion Probability Value", "0.229"},
|
||||
{"Kelly Criterion Estimate", "38.796"},
|
||||
{"Kelly Criterion Probability Value", "0.228"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "69.159"},
|
||||
{"Return Over Maximum Drawdown", "69.017"},
|
||||
{"Portfolio Turnover", "1.242"},
|
||||
{"Total Insights Generated", "100"},
|
||||
{"Total Insights Closed", "99"},
|
||||
@@ -98,14 +99,14 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Long Insight Count", "100"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$126657.6305"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$20405.9516"},
|
||||
{"Mean Population Estimated Insight Value", "$206.1207"},
|
||||
{"Mean Population Direction", "54.5455%"},
|
||||
{"Mean Population Magnitude", "54.5455%"},
|
||||
{"Rolling Averaged Population Direction", "59.8056%"},
|
||||
{"Rolling Averaged Population Magnitude", "59.8056%"},
|
||||
{"OrderListHash", "e0f388bf9e88b34388c866150b292573"}
|
||||
{"Estimated Monthly Alpha Value", "$135639.1761"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$21852.9784"},
|
||||
{"Mean Population Estimated Insight Value", "$220.7372"},
|
||||
{"Mean Population Direction", "53.5354%"},
|
||||
{"Mean Population Magnitude", "53.5354%"},
|
||||
{"Rolling Averaged Population Direction", "58.2788%"},
|
||||
{"Rolling Averaged Population Magnitude", "58.2788%"},
|
||||
{"OrderListHash", "d8d556bcf963ba50f85cea387c55922b"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,32 +74,33 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "6"},
|
||||
{"Total Trades", "5"},
|
||||
{"Average Win", "0.00%"},
|
||||
{"Average Loss", "0.00%"},
|
||||
{"Compounding Annual Return", "38.059%"},
|
||||
{"Compounding Annual Return", "38.796%"},
|
||||
{"Drawdown", "0.600%"},
|
||||
{"Expectancy", "-0.502"},
|
||||
{"Net Profit", "0.413%"},
|
||||
{"Sharpe Ratio", "5.518"},
|
||||
{"Probabilistic Sharpe Ratio", "66.933%"},
|
||||
{"Loss Rate", "67%"},
|
||||
{"Win Rate", "33%"},
|
||||
{"Profit-Loss Ratio", "0.50"},
|
||||
{"Alpha", "-0.178"},
|
||||
{"Expectancy", "-0.247"},
|
||||
{"Net Profit", "0.420%"},
|
||||
{"Sharpe Ratio", "5.57"},
|
||||
{"Probabilistic Sharpe Ratio", "67.303%"},
|
||||
{"Loss Rate", "50%"},
|
||||
{"Win Rate", "50%"},
|
||||
{"Profit-Loss Ratio", "0.51"},
|
||||
{"Alpha", "-0.185"},
|
||||
{"Beta", "0.249"},
|
||||
{"Annual Standard Deviation", "0.055"},
|
||||
{"Annual Variance", "0.003"},
|
||||
{"Information Ratio", "-9.844"},
|
||||
{"Tracking Error", "0.165"},
|
||||
{"Treynor Ratio", "1.212"},
|
||||
{"Total Fees", "$6.00"},
|
||||
{"Information Ratio", "-10.015"},
|
||||
{"Tracking Error", "0.167"},
|
||||
{"Treynor Ratio", "1.24"},
|
||||
{"Total Fees", "$5.00"},
|
||||
{"Estimated Strategy Capacity", "$42000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.063"},
|
||||
{"Kelly Criterion Estimate", "38.64"},
|
||||
{"Kelly Criterion Probability Value", "0.229"},
|
||||
{"Kelly Criterion Estimate", "38.796"},
|
||||
{"Kelly Criterion Probability Value", "0.228"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "70.188"},
|
||||
{"Return Over Maximum Drawdown", "71.109"},
|
||||
{"Portfolio Turnover", "0.063"},
|
||||
{"Total Insights Generated", "100"},
|
||||
{"Total Insights Closed", "99"},
|
||||
@@ -107,14 +108,14 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Long Insight Count", "100"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$126657.6305"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$20405.9516"},
|
||||
{"Mean Population Estimated Insight Value", "$206.1207"},
|
||||
{"Mean Population Direction", "54.5455%"},
|
||||
{"Mean Population Magnitude", "54.5455%"},
|
||||
{"Rolling Averaged Population Direction", "59.8056%"},
|
||||
{"Rolling Averaged Population Magnitude", "59.8056%"},
|
||||
{"OrderListHash", "07eb3e2c199575b547459a534057eb5e"}
|
||||
{"Estimated Monthly Alpha Value", "$135639.1761"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$21852.9784"},
|
||||
{"Mean Population Estimated Insight Value", "$220.7372"},
|
||||
{"Mean Population Direction", "53.5354%"},
|
||||
{"Mean Population Magnitude", "53.5354%"},
|
||||
{"Rolling Averaged Population Direction", "58.2788%"},
|
||||
{"Rolling Averaged Population Magnitude", "58.2788%"},
|
||||
{"OrderListHash", "6ab0483f63f36295e21400be1271ad40"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,15 +156,16 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "5.579"},
|
||||
{"Beta", "-63.972"},
|
||||
{"Alpha", "5.56"},
|
||||
{"Beta", "-71.105"},
|
||||
{"Annual Standard Deviation", "0.434"},
|
||||
{"Annual Variance", "0.188"},
|
||||
{"Information Ratio", "0.996"},
|
||||
{"Tracking Error", "0.441"},
|
||||
{"Treynor Ratio", "-0.008"},
|
||||
{"Information Ratio", "1.016"},
|
||||
{"Tracking Error", "0.44"},
|
||||
{"Treynor Ratio", "-0.007"},
|
||||
{"Total Fees", "$20.35"},
|
||||
{"Estimated Strategy Capacity", "$19000000.00"},
|
||||
{"Lowest Capacity Asset", "ES VMKLFZIH2MTD"},
|
||||
{"Fitness Score", "0.138"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
|
||||
@@ -172,30 +172,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{
|
||||
{"Total Trades", "2"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "-0.52%"},
|
||||
{"Compounding Annual Return", "-31.636%"},
|
||||
{"Average Loss", "-0.54%"},
|
||||
{"Compounding Annual Return", "-32.671%"},
|
||||
{"Drawdown", "0.900%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "-0.520%"},
|
||||
{"Sharpe Ratio", "-3.097"},
|
||||
{"Probabilistic Sharpe Ratio", "24.675%"},
|
||||
{"Net Profit", "-0.540%"},
|
||||
{"Sharpe Ratio", "-3.168"},
|
||||
{"Probabilistic Sharpe Ratio", "23.963%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "-0.443"},
|
||||
{"Alpha", "-0.456"},
|
||||
{"Beta", "0.157"},
|
||||
{"Annual Standard Deviation", "0.074"},
|
||||
{"Annual Variance", "0.005"},
|
||||
{"Information Ratio", "-9.046"},
|
||||
{"Tracking Error", "0.176"},
|
||||
{"Treynor Ratio", "-1.46"},
|
||||
{"Total Fees", "$7.82"},
|
||||
{"Estimated Strategy Capacity", "$12000000.00"},
|
||||
{"Annual Standard Deviation", "0.075"},
|
||||
{"Annual Variance", "0.006"},
|
||||
{"Information Ratio", "-9.176"},
|
||||
{"Tracking Error", "0.178"},
|
||||
{"Treynor Ratio", "-1.514"},
|
||||
{"Total Fees", "$32.32"},
|
||||
{"Estimated Strategy Capacity", "$95000000.00"},
|
||||
{"Lowest Capacity Asset", "AAPL R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.1"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "-35.683"},
|
||||
{"Return Over Maximum Drawdown", "-36.199"},
|
||||
{"Portfolio Turnover", "0.2"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
@@ -210,7 +211,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "71984e154883ece4aef1d71bafbfccaf"}
|
||||
{"OrderListHash", "3b9c93151bf191a82529e6e915961356"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,29 +128,30 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{
|
||||
{"Total Trades", "85"},
|
||||
{"Average Win", "4.85%"},
|
||||
{"Average Loss", "-4.21%"},
|
||||
{"Compounding Annual Return", "-3.100%"},
|
||||
{"Drawdown", "52.900%"},
|
||||
{"Expectancy", "-0.052"},
|
||||
{"Net Profit", "-29.298%"},
|
||||
{"Sharpe Ratio", "-0.076"},
|
||||
{"Average Loss", "-4.22%"},
|
||||
{"Compounding Annual Return", "-3.124%"},
|
||||
{"Drawdown", "53.000%"},
|
||||
{"Expectancy", "-0.053"},
|
||||
{"Net Profit", "-29.486%"},
|
||||
{"Sharpe Ratio", "-0.078"},
|
||||
{"Probabilistic Sharpe Ratio", "0.004%"},
|
||||
{"Loss Rate", "56%"},
|
||||
{"Win Rate", "44%"},
|
||||
{"Profit-Loss Ratio", "1.15"},
|
||||
{"Alpha", "-0.013"},
|
||||
{"Beta", "0.009"},
|
||||
{"Annual Standard Deviation", "0.164"},
|
||||
{"Beta", "0.007"},
|
||||
{"Annual Standard Deviation", "0.163"},
|
||||
{"Annual Variance", "0.027"},
|
||||
{"Information Ratio", "-0.391"},
|
||||
{"Tracking Error", "0.239"},
|
||||
{"Treynor Ratio", "-1.435"},
|
||||
{"Total Fees", "$755.29"},
|
||||
{"Estimated Strategy Capacity", "$1100000000.00"},
|
||||
{"Information Ratio", "-0.393"},
|
||||
{"Tracking Error", "0.238"},
|
||||
{"Treynor Ratio", "-1.72"},
|
||||
{"Total Fees", "$796.82"},
|
||||
{"Estimated Strategy Capacity", "$1200000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.024"},
|
||||
{"Kelly Criterion Estimate", "-0.84"},
|
||||
{"Kelly Criterion Probability Value", "0.53"},
|
||||
{"Sortino Ratio", "-0.224"},
|
||||
{"Kelly Criterion Estimate", "-0.9"},
|
||||
{"Kelly Criterion Probability Value", "0.532"},
|
||||
{"Sortino Ratio", "-0.228"},
|
||||
{"Return Over Maximum Drawdown", "-0.058"},
|
||||
{"Portfolio Turnover", "0.05"},
|
||||
{"Total Insights Generated", "85"},
|
||||
@@ -159,14 +160,14 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Long Insight Count", "42"},
|
||||
{"Short Insight Count", "43"},
|
||||
{"Long/Short Ratio", "97.67%"},
|
||||
{"Estimated Monthly Alpha Value", "$-617339.2"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$-82686580"},
|
||||
{"Mean Population Estimated Insight Value", "$-972783.3"},
|
||||
{"Estimated Monthly Alpha Value", "$-719932.6"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$-96427970"},
|
||||
{"Mean Population Estimated Insight Value", "$-1134447"},
|
||||
{"Mean Population Direction", "51.7647%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "48.2217%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "95f34359f25a7a7a2725f0343a75a105"}
|
||||
{"OrderListHash", "177fb7f308a252864365442a30dd9eeb"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,29 +82,30 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Trades", "1"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "264.819%"},
|
||||
{"Compounding Annual Return", "272.157%"},
|
||||
{"Drawdown", "2.200%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "1.668%"},
|
||||
{"Sharpe Ratio", "8.749"},
|
||||
{"Probabilistic Sharpe Ratio", "67.311%"},
|
||||
{"Net Profit", "1.694%"},
|
||||
{"Sharpe Ratio", "8.897"},
|
||||
{"Probabilistic Sharpe Ratio", "67.609%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "1.119"},
|
||||
{"Beta", "0.805"},
|
||||
{"Annual Standard Deviation", "0.219"},
|
||||
{"Annual Variance", "0.048"},
|
||||
{"Information Ratio", "5.494"},
|
||||
{"Tracking Error", "0.168"},
|
||||
{"Treynor Ratio", "2.38"},
|
||||
{"Total Fees", "$3.26"},
|
||||
{"Estimated Strategy Capacity", "$300000000.00"},
|
||||
{"Fitness Score", "0.245"},
|
||||
{"Alpha", "1.144"},
|
||||
{"Beta", "0.842"},
|
||||
{"Annual Standard Deviation", "0.222"},
|
||||
{"Annual Variance", "0.049"},
|
||||
{"Information Ratio", "5.987"},
|
||||
{"Tracking Error", "0.165"},
|
||||
{"Treynor Ratio", "2.347"},
|
||||
{"Total Fees", "$3.45"},
|
||||
{"Estimated Strategy Capacity", "$310000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.246"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "9.606"},
|
||||
{"Return Over Maximum Drawdown", "105.85"},
|
||||
{"Sortino Ratio", "9.761"},
|
||||
{"Return Over Maximum Drawdown", "107.509"},
|
||||
{"Portfolio Turnover", "0.249"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
@@ -119,7 +120,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "9cd604d2c1e3c273697e2ff2cc7faef1"}
|
||||
{"OrderListHash", "e10039d74166b161f3ea2851a5e85843"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,12 +79,12 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Trades", "1"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "37.355%"},
|
||||
{"Compounding Annual Return", "34.768%"},
|
||||
{"Drawdown", "2.300%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0.407%"},
|
||||
{"Sharpe Ratio", "5.521"},
|
||||
{"Probabilistic Sharpe Ratio", "60.177%"},
|
||||
{"Net Profit", "0.382%"},
|
||||
{"Sharpe Ratio", "5.488"},
|
||||
{"Probabilistic Sharpe Ratio", "60.047%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
@@ -92,17 +92,18 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Beta", "0.997"},
|
||||
{"Annual Standard Deviation", "0.179"},
|
||||
{"Annual Variance", "0.032"},
|
||||
{"Information Ratio", "-7.662"},
|
||||
{"Information Ratio", "-7.724"},
|
||||
{"Tracking Error", "0"},
|
||||
{"Treynor Ratio", "0.988"},
|
||||
{"Total Fees", "$7.78"},
|
||||
{"Estimated Strategy Capacity", "$8700000.00"},
|
||||
{"Fitness Score", "0.031"},
|
||||
{"Treynor Ratio", "0.986"},
|
||||
{"Total Fees", "$32.11"},
|
||||
{"Estimated Strategy Capacity", "$66000000.00"},
|
||||
{"Lowest Capacity Asset", "AAPL R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.029"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "-2.145"},
|
||||
{"Return Over Maximum Drawdown", "-8.479"},
|
||||
{"Portfolio Turnover", "0.25"},
|
||||
{"Sortino Ratio", "-2.336"},
|
||||
{"Return Over Maximum Drawdown", "-8.991"},
|
||||
{"Portfolio Turnover", "0.251"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
@@ -116,7 +117,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "be3334e4aeb9dd7cca4ecc07419d0f95"}
|
||||
{"OrderListHash", "9ce7252112d0ad7be0704297f7d48a88"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,11 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
public override HasSufficientBuyingPowerForOrderResult HasSufficientBuyingPowerForOrder(
|
||||
HasSufficientBuyingPowerForOrderParameters parameters)
|
||||
{
|
||||
return new HasSufficientBuyingPowerForOrderResult(true);
|
||||
// if portfolio doesn't have enough buying power:
|
||||
// parameters.Insufficient()
|
||||
|
||||
// this model never allows a lack of funds get in the way of buying securities
|
||||
return parameters.Sufficient();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,30 +100,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Trades", "1"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "5672.520%"},
|
||||
{"Drawdown", "22.500%"},
|
||||
{"Compounding Annual Return", "4775.196%"},
|
||||
{"Drawdown", "21.600%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "40.601%"},
|
||||
{"Sharpe Ratio", "40.201"},
|
||||
{"Probabilistic Sharpe Ratio", "77.339%"},
|
||||
{"Net Profit", "38.619%"},
|
||||
{"Sharpe Ratio", "33.779"},
|
||||
{"Probabilistic Sharpe Ratio", "77.029%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "41.848"},
|
||||
{"Beta", "9.224"},
|
||||
{"Annual Standard Deviation", "1.164"},
|
||||
{"Annual Variance", "1.355"},
|
||||
{"Information Ratio", "44.459"},
|
||||
{"Tracking Error", "1.04"},
|
||||
{"Treynor Ratio", "5.073"},
|
||||
{"Alpha", "32.812"},
|
||||
{"Beta", "8.756"},
|
||||
{"Annual Standard Deviation", "1.11"},
|
||||
{"Annual Variance", "1.231"},
|
||||
{"Information Ratio", "37.501"},
|
||||
{"Tracking Error", "0.985"},
|
||||
{"Treynor Ratio", "4.281"},
|
||||
{"Total Fees", "$30.00"},
|
||||
{"Estimated Strategy Capacity", "$20000000.00"},
|
||||
{"Fitness Score", "0.418"},
|
||||
{"Estimated Strategy Capacity", "$22000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.395"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "113.05"},
|
||||
{"Return Over Maximum Drawdown", "442.81"},
|
||||
{"Portfolio Turnover", "0.418"},
|
||||
{"Sortino Ratio", "98.148"},
|
||||
{"Return Over Maximum Drawdown", "384.626"},
|
||||
{"Portfolio Turnover", "0.395"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
@@ -133,7 +138,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "b88362c462e9ab2942cbcb8dfddc6ce0"}
|
||||
{"OrderListHash", "3df007afa8125770e8f1a49263af90a2"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,29 +102,30 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Trades", "1"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "-33.612%"},
|
||||
{"Compounding Annual Return", "-33.427%"},
|
||||
{"Drawdown", "2.000%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "-1.669%"},
|
||||
{"Sharpe Ratio", "-4.888"},
|
||||
{"Probabilistic Sharpe Ratio", "5.495%"},
|
||||
{"Net Profit", "-1.658%"},
|
||||
{"Sharpe Ratio", "-4.841"},
|
||||
{"Probabilistic Sharpe Ratio", "5.714%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "-0.273"},
|
||||
{"Beta", "0.045"},
|
||||
{"Alpha", "-0.271"},
|
||||
{"Beta", "0.046"},
|
||||
{"Annual Standard Deviation", "0.057"},
|
||||
{"Annual Variance", "0.003"},
|
||||
{"Information Ratio", "-1.537"},
|
||||
{"Information Ratio", "-1.563"},
|
||||
{"Tracking Error", "0.112"},
|
||||
{"Treynor Ratio", "-6.121"},
|
||||
{"Total Fees", "$3.50"},
|
||||
{"Estimated Strategy Capacity", "$48000000.00"},
|
||||
{"Treynor Ratio", "-6.032"},
|
||||
{"Total Fees", "$14.45"},
|
||||
{"Estimated Strategy Capacity", "$370000000.00"},
|
||||
{"Lowest Capacity Asset", "AAPL R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "-7.289"},
|
||||
{"Return Over Maximum Drawdown", "-16.95"},
|
||||
{"Sortino Ratio", "-7.238"},
|
||||
{"Return Over Maximum Drawdown", "-16.848"},
|
||||
{"Portfolio Turnover", "0.038"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
@@ -139,7 +140,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "6b05339bfcb5bd93bfd66e32a1d2181a"}
|
||||
{"OrderListHash", "0f5b98e8a608408a9d80d8b32ef3f845"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,29 +107,30 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Trades", "1"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "-33.612%"},
|
||||
{"Compounding Annual Return", "-33.427%"},
|
||||
{"Drawdown", "2.000%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "-1.669%"},
|
||||
{"Sharpe Ratio", "-4.888"},
|
||||
{"Probabilistic Sharpe Ratio", "5.495%"},
|
||||
{"Net Profit", "-1.658%"},
|
||||
{"Sharpe Ratio", "-4.841"},
|
||||
{"Probabilistic Sharpe Ratio", "5.714%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "-0.273"},
|
||||
{"Beta", "0.045"},
|
||||
{"Alpha", "-0.271"},
|
||||
{"Beta", "0.046"},
|
||||
{"Annual Standard Deviation", "0.057"},
|
||||
{"Annual Variance", "0.003"},
|
||||
{"Information Ratio", "-1.537"},
|
||||
{"Information Ratio", "-1.563"},
|
||||
{"Tracking Error", "0.112"},
|
||||
{"Treynor Ratio", "-6.121"},
|
||||
{"Total Fees", "$3.50"},
|
||||
{"Estimated Strategy Capacity", "$48000000.00"},
|
||||
{"Treynor Ratio", "-6.032"},
|
||||
{"Total Fees", "$14.45"},
|
||||
{"Estimated Strategy Capacity", "$370000000.00"},
|
||||
{"Lowest Capacity Asset", "AAPL R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "-7.289"},
|
||||
{"Return Over Maximum Drawdown", "-16.95"},
|
||||
{"Sortino Ratio", "-7.238"},
|
||||
{"Return Over Maximum Drawdown", "-16.848"},
|
||||
{"Portfolio Turnover", "0.038"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
@@ -144,7 +145,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "6b05339bfcb5bd93bfd66e32a1d2181a"}
|
||||
{"OrderListHash", "0f5b98e8a608408a9d80d8b32ef3f845"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,29 +114,30 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Trades", "1"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "31.756%"},
|
||||
{"Compounding Annual Return", "32.142%"},
|
||||
{"Drawdown", "0.700%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0.378%"},
|
||||
{"Sharpe Ratio", "2.708"},
|
||||
{"Probabilistic Sharpe Ratio", "56.960%"},
|
||||
{"Net Profit", "0.383%"},
|
||||
{"Sharpe Ratio", "2.719"},
|
||||
{"Probabilistic Sharpe Ratio", "57.021%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "0.079"},
|
||||
{"Beta", "0.099"},
|
||||
{"Alpha", "0.086"},
|
||||
{"Beta", "0.092"},
|
||||
{"Annual Standard Deviation", "0.079"},
|
||||
{"Annual Variance", "0.006"},
|
||||
{"Information Ratio", "-6.058"},
|
||||
{"Tracking Error", "0.19"},
|
||||
{"Treynor Ratio", "2.159"},
|
||||
{"Information Ratio", "-6.123"},
|
||||
{"Tracking Error", "0.193"},
|
||||
{"Treynor Ratio", "2.331"},
|
||||
{"Total Fees", "$1.00"},
|
||||
{"Estimated Strategy Capacity", "$58000000.00"},
|
||||
{"Estimated Strategy Capacity", "$120000000.00"},
|
||||
{"Lowest Capacity Asset", "GOOG T1AZ164W5VTX"},
|
||||
{"Fitness Score", "0.1"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "47.335"},
|
||||
{"Return Over Maximum Drawdown", "47.911"},
|
||||
{"Portfolio Turnover", "0.1"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
@@ -151,7 +152,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "214f38f9084bc350c93010aa2fb69822"}
|
||||
{"OrderListHash", "831c0062f40b638713d534d080a5ffcc"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
|
||||
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
|
||||
*
|
||||
@@ -172,4 +172,4 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,14 +124,15 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "1.736"},
|
||||
{"Beta", "0.136"},
|
||||
{"Beta", "0.142"},
|
||||
{"Annual Standard Deviation", "0.84"},
|
||||
{"Annual Variance", "0.706"},
|
||||
{"Information Ratio", "1.925"},
|
||||
{"Tracking Error", "0.846"},
|
||||
{"Treynor Ratio", "12.904"},
|
||||
{"Treynor Ratio", "12.334"},
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", "BTC.Bitcoin 2S"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
@@ -259,4 +260,4 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,14 +94,15 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "1.736"},
|
||||
{"Beta", "0.136"},
|
||||
{"Beta", "0.142"},
|
||||
{"Annual Standard Deviation", "0.84"},
|
||||
{"Annual Variance", "0.706"},
|
||||
{"Information Ratio", "1.925"},
|
||||
{"Tracking Error", "0.846"},
|
||||
{"Treynor Ratio", "12.903"},
|
||||
{"Treynor Ratio", "12.333"},
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", "BTC.Bitcoin 2S"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
@@ -229,4 +230,4 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,29 +124,30 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Trades", "1"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "-99.920%"},
|
||||
{"Drawdown", "11.100%"},
|
||||
{"Compounding Annual Return", "-99.907%"},
|
||||
{"Drawdown", "11.000%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "-10.486%"},
|
||||
{"Sharpe Ratio", "-1.534"},
|
||||
{"Net Profit", "-10.343%"},
|
||||
{"Sharpe Ratio", "-1.554"},
|
||||
{"Probabilistic Sharpe Ratio", "0.001%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "-0.898"},
|
||||
{"Beta", "-7.027"},
|
||||
{"Annual Standard Deviation", "0.651"},
|
||||
{"Annual Variance", "0.424"},
|
||||
{"Information Ratio", "-1.396"},
|
||||
{"Tracking Error", "0.726"},
|
||||
{"Treynor Ratio", "0.142"},
|
||||
{"Alpha", "-0.91"},
|
||||
{"Beta", "-5.602"},
|
||||
{"Annual Standard Deviation", "0.643"},
|
||||
{"Annual Variance", "0.413"},
|
||||
{"Information Ratio", "-1.378"},
|
||||
{"Tracking Error", "0.736"},
|
||||
{"Treynor Ratio", "0.178"},
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", "NWSA.CustomDataUsingMapping T3MO1488O0H0"},
|
||||
{"Fitness Score", "0.127"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "-9.383"},
|
||||
{"Return Over Maximum Drawdown", "-9.481"},
|
||||
{"Portfolio Turnover", "0.249"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
@@ -161,7 +162,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "1c319ae4b15416184a247bb47b31aabc"}
|
||||
{"OrderListHash", "d4cf2839e74df7fa436e30f44be4cb57"}
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -193,31 +193,32 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "62"},
|
||||
{"Average Win", "0.10%"},
|
||||
{"Average Win", "0.11%"},
|
||||
{"Average Loss", "-0.06%"},
|
||||
{"Compounding Annual Return", "-7.727%"},
|
||||
{"Compounding Annual Return", "-7.236%"},
|
||||
{"Drawdown", "2.400%"},
|
||||
{"Expectancy", "-0.197"},
|
||||
{"Net Profit", "-0.673%"},
|
||||
{"Sharpe Ratio", "-1.565"},
|
||||
{"Probabilistic Sharpe Ratio", "22.763%"},
|
||||
{"Expectancy", "-0.187"},
|
||||
{"Net Profit", "-0.629%"},
|
||||
{"Sharpe Ratio", "-1.475"},
|
||||
{"Probabilistic Sharpe Ratio", "23.597%"},
|
||||
{"Loss Rate", "70%"},
|
||||
{"Win Rate", "30%"},
|
||||
{"Profit-Loss Ratio", "1.70"},
|
||||
{"Alpha", "-0.14"},
|
||||
{"Beta", "0.124"},
|
||||
{"Profit-Loss Ratio", "1.73"},
|
||||
{"Alpha", "-0.136"},
|
||||
{"Beta", "0.126"},
|
||||
{"Annual Standard Deviation", "0.047"},
|
||||
{"Annual Variance", "0.002"},
|
||||
{"Information Ratio", "-5.163"},
|
||||
{"Information Ratio", "-5.094"},
|
||||
{"Tracking Error", "0.118"},
|
||||
{"Treynor Ratio", "-0.591"},
|
||||
{"Total Fees", "$62.24"},
|
||||
{"Estimated Strategy Capacity", "$49000000.00"},
|
||||
{"Fitness Score", "0.147"},
|
||||
{"Treynor Ratio", "-0.547"},
|
||||
{"Total Fees", "$62.25"},
|
||||
{"Estimated Strategy Capacity", "$52000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.16"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "-2.792"},
|
||||
{"Return Over Maximum Drawdown", "-3.569"},
|
||||
{"Sortino Ratio", "-2.59"},
|
||||
{"Return Over Maximum Drawdown", "-3.337"},
|
||||
{"Portfolio Turnover", "2.562"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
@@ -232,7 +233,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "71c17655bd0731eb25433727526e95ba"}
|
||||
{"OrderListHash", "1118fb362bfe261323a6b496d50bddde"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,29 +86,30 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Trades", "1"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "241.885%"},
|
||||
{"Drawdown", "1.100%"},
|
||||
{"Compounding Annual Return", "240.939%"},
|
||||
{"Drawdown", "1.200%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "1.698%"},
|
||||
{"Sharpe Ratio", "7.17"},
|
||||
{"Probabilistic Sharpe Ratio", "68.718%"},
|
||||
{"Net Profit", "1.694%"},
|
||||
{"Sharpe Ratio", "6.988"},
|
||||
{"Probabilistic Sharpe Ratio", "68.188%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "1.171"},
|
||||
{"Beta", "0.147"},
|
||||
{"Annual Standard Deviation", "0.191"},
|
||||
{"Annual Variance", "0.037"},
|
||||
{"Information Ratio", "0.035"},
|
||||
{"Tracking Error", "0.251"},
|
||||
{"Treynor Ratio", "9.323"},
|
||||
{"Total Fees", "$3.26"},
|
||||
{"Estimated Strategy Capacity", "$890000000.00"},
|
||||
{"Alpha", "1.172"},
|
||||
{"Beta", "0.14"},
|
||||
{"Annual Standard Deviation", "0.196"},
|
||||
{"Annual Variance", "0.038"},
|
||||
{"Information Ratio", "-0.118"},
|
||||
{"Tracking Error", "0.256"},
|
||||
{"Treynor Ratio", "9.783"},
|
||||
{"Total Fees", "$3.45"},
|
||||
{"Estimated Strategy Capacity", "$970000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.201"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "211.158"},
|
||||
{"Return Over Maximum Drawdown", "204.701"},
|
||||
{"Portfolio Turnover", "0.201"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
@@ -123,7 +124,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "82fee25cd17100c53bb173834ab5f0b2"}
|
||||
{"OrderListHash", "33d01821923c397f999cfb2e5b5928ad"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,11 +189,12 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Beta", "0"},
|
||||
{"Annual Standard Deviation", "0"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-2.53"},
|
||||
{"Tracking Error", "0.211"},
|
||||
{"Information Ratio", "-2.564"},
|
||||
{"Tracking Error", "0.214"},
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", ""},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
|
||||
@@ -114,11 +114,12 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Beta", "0"},
|
||||
{"Annual Standard Deviation", "0"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-0.084"},
|
||||
{"Tracking Error", "0.183"},
|
||||
{"Information Ratio", "-0.098"},
|
||||
{"Tracking Error", "0.179"},
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", ""},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
|
||||
@@ -114,11 +114,12 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Beta", "0"},
|
||||
{"Annual Standard Deviation", "0"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-0.096"},
|
||||
{"Tracking Error", "0.212"},
|
||||
{"Information Ratio", "-0.111"},
|
||||
{"Tracking Error", "0.207"},
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", ""},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
|
||||
@@ -112,6 +112,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", ""},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
|
||||
@@ -137,6 +137,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", ""},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
|
||||
@@ -106,14 +106,15 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Win Rate", "100%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "0.006"},
|
||||
{"Beta", "0.158"},
|
||||
{"Beta", "0.157"},
|
||||
{"Annual Standard Deviation", "0.033"},
|
||||
{"Annual Variance", "0.001"},
|
||||
{"Information Ratio", "-4.942"},
|
||||
{"Tracking Error", "0.08"},
|
||||
{"Treynor Ratio", "0.517"},
|
||||
{"Information Ratio", "-4.901"},
|
||||
{"Tracking Error", "0.081"},
|
||||
{"Treynor Ratio", "0.519"},
|
||||
{"Total Fees", "$3.70"},
|
||||
{"Estimated Strategy Capacity", "$270000000.00"},
|
||||
{"Estimated Strategy Capacity", "$170000000.00"},
|
||||
{"Lowest Capacity Asset", "ES VMKLFZIH2MTD"},
|
||||
{"Fitness Score", "0.019"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
|
||||
172
Algorithm.CSharp/DelistedIndexOptionDivestedRegression.cs
Normal file
172
Algorithm.CSharp/DelistedIndexOptionDivestedRegression.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 System.Linq;
|
||||
using QuantConnect.Data;
|
||||
using QuantConnect.Data.Market;
|
||||
using QuantConnect.Interfaces;
|
||||
|
||||
namespace QuantConnect.Algorithm.CSharp
|
||||
{
|
||||
public class DelistedIndexOptionDivestedRegression : QCAlgorithm, IRegressionAlgorithmDefinition
|
||||
{
|
||||
private Symbol _spx;
|
||||
private Symbol _optionSymbol;
|
||||
private DateTime _optionExpiry = DateTime.MaxValue;
|
||||
private string _ticker;
|
||||
private bool _addOption = true;
|
||||
private bool _receivedWarning;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
SetStartDate(2021, 1, 3); //Set Start Date
|
||||
SetEndDate(2021, 1, 20); //Set End Date
|
||||
|
||||
_ticker = "SPX";
|
||||
var spxSecurity = AddIndex(_ticker, Resolution.Minute);
|
||||
spxSecurity.SetDataNormalizationMode(DataNormalizationMode.Raw);
|
||||
_spx = spxSecurity.Symbol;
|
||||
}
|
||||
|
||||
public override void OnData(Slice slice)
|
||||
{
|
||||
if (!slice.ContainsKey(_spx))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_addOption)
|
||||
{
|
||||
var contracts = OptionChainProvider.GetOptionContractList(_spx, Time);
|
||||
contracts = contracts.Where(x =>
|
||||
x.ID.OptionRight == OptionRight.Put &&
|
||||
x.ID.Date.Date == new DateTime(2021, 1, 15));
|
||||
|
||||
var option = AddIndexOptionContract(contracts.First(), Resolution.Minute);
|
||||
_optionExpiry = option.Expiry;
|
||||
_optionSymbol = option.Symbol;
|
||||
|
||||
|
||||
_addOption = false;
|
||||
}
|
||||
|
||||
if (slice.ContainsKey(_optionSymbol))
|
||||
{
|
||||
if (!Portfolio.Invested)
|
||||
{
|
||||
SetHoldings(_optionSymbol, 0.25);
|
||||
}
|
||||
|
||||
// Verify the order of delisting; warning then delisting
|
||||
Delisting delisting;
|
||||
if (slice.Delistings.TryGetValue(_optionSymbol, out delisting))
|
||||
{
|
||||
switch (delisting.Type)
|
||||
{
|
||||
case DelistingType.Warning:
|
||||
_receivedWarning = true;
|
||||
break;
|
||||
case DelistingType.Delisted:
|
||||
if (!_receivedWarning)
|
||||
{
|
||||
throw new Exception("Did not receive warning before delisting");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Verify we aren't receiving expired option data.
|
||||
if (_optionExpiry < Time.Date)
|
||||
{
|
||||
throw new Exception($"Received expired contract {_optionSymbol} expired: {_optionExpiry} current time: {Time}");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
public override void OnEndOfAlgorithm()
|
||||
{
|
||||
foreach (var holding in Portfolio.Values)
|
||||
{
|
||||
Log($"Holding {holding.Symbol.Value}; Invested: {holding.Invested}; Quantity: {holding.Quantity}");
|
||||
|
||||
if (holding.Symbol == _optionSymbol && holding.Invested)
|
||||
{
|
||||
throw new Exception($"Index option {_optionSymbol.Value} is still invested after delisting");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <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>
|
||||
/// This is used by the regression test system to indicate what the expected statistics are from running the algorithm
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "2"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "-26.40%"},
|
||||
{"Compounding Annual Return", "-99.821%"},
|
||||
{"Drawdown", "45.600%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "-26.400%"},
|
||||
{"Sharpe Ratio", "-0.557"},
|
||||
{"Probabilistic Sharpe Ratio", "20.162%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "-0.564"},
|
||||
{"Beta", "-0.663"},
|
||||
{"Annual Standard Deviation", "1.752"},
|
||||
{"Annual Variance", "3.069"},
|
||||
{"Information Ratio", "-0.906"},
|
||||
{"Tracking Error", "1.763"},
|
||||
{"Treynor Ratio", "1.472"},
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$1000000.00"},
|
||||
{"Lowest Capacity Asset", "SPX 31KC0UJFONTBI|SPX 31"},
|
||||
{"Fitness Score", "0.005"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "-0.249"},
|
||||
{"Return Over Maximum Drawdown", "-2.699"},
|
||||
{"Portfolio Turnover", "0.016"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
{"Long Insight Count", "0"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$0"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$0"},
|
||||
{"Mean Population Estimated Insight Value", "$0"},
|
||||
{"Mean Population Direction", "0%"},
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "4ae4c1d8e4054c41908fd36e893699a6"}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -160,7 +160,8 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Tracking Error", "0.155"},
|
||||
{"Treynor Ratio", "1.589"},
|
||||
{"Total Fees", "$55.05"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Estimated Strategy Capacity", "$43000.00"},
|
||||
{"Lowest Capacity Asset", "AAA SEVKGI6HF885"},
|
||||
{"Fitness Score", "0.002"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
|
||||
@@ -119,11 +119,12 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Beta", "-0.001"},
|
||||
{"Annual Standard Deviation", "0.001"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-1.187"},
|
||||
{"Tracking Error", "0.115"},
|
||||
{"Treynor Ratio", "1.545"},
|
||||
{"Information Ratio", "-1.182"},
|
||||
{"Tracking Error", "0.117"},
|
||||
{"Treynor Ratio", "1.617"},
|
||||
{"Total Fees", "$37.00"},
|
||||
{"Estimated Strategy Capacity", "$400000.00"},
|
||||
{"Estimated Strategy Capacity", "$860000000.00"},
|
||||
{"Lowest Capacity Asset", "DC V5E8P9SH0U0X"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
|
||||
@@ -167,31 +167,32 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "7"},
|
||||
{"Average Win", "19.16%"},
|
||||
{"Average Win", "19.18%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "16.727%"},
|
||||
{"Drawdown", "12.200%"},
|
||||
{"Compounding Annual Return", "16.740%"},
|
||||
{"Drawdown", "12.400%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "153.058%"},
|
||||
{"Sharpe Ratio", "1.239"},
|
||||
{"Probabilistic Sharpe Ratio", "66.414%"},
|
||||
{"Net Profit", "153.224%"},
|
||||
{"Sharpe Ratio", "1.233"},
|
||||
{"Probabilistic Sharpe Ratio", "65.906%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "100%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "0.146"},
|
||||
{"Beta", "-0.018"},
|
||||
{"Annual Standard Deviation", "0.116"},
|
||||
{"Annual Variance", "0.013"},
|
||||
{"Information Ratio", "-0.053"},
|
||||
{"Beta", "-0.016"},
|
||||
{"Annual Standard Deviation", "0.117"},
|
||||
{"Annual Variance", "0.014"},
|
||||
{"Information Ratio", "-0.052"},
|
||||
{"Tracking Error", "0.204"},
|
||||
{"Treynor Ratio", "-8.165"},
|
||||
{"Total Fees", "$46.75"},
|
||||
{"Estimated Strategy Capacity", "$670000000.00"},
|
||||
{"Treynor Ratio", "-8.847"},
|
||||
{"Total Fees", "$49.43"},
|
||||
{"Estimated Strategy Capacity", "$740000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.002"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "1.607"},
|
||||
{"Return Over Maximum Drawdown", "1.366"},
|
||||
{"Sortino Ratio", "1.609"},
|
||||
{"Return Over Maximum Drawdown", "1.351"},
|
||||
{"Portfolio Turnover", "0.003"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
@@ -206,7 +207,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "7c4fcd79dd817a9cd3bf44525eaed96c"}
|
||||
{"OrderListHash", "44481c3d7eeb5acd5e3bccfec501a132"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,30 +187,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Trades", "6441"},
|
||||
{"Average Win", "0.07%"},
|
||||
{"Average Loss", "-0.07%"},
|
||||
{"Compounding Annual Return", "13.331%"},
|
||||
{"Drawdown", "10.700%"},
|
||||
{"Expectancy", "0.061"},
|
||||
{"Net Profit", "13.331%"},
|
||||
{"Sharpe Ratio", "0.963"},
|
||||
{"Probabilistic Sharpe Ratio", "46.232%"},
|
||||
{"Compounding Annual Return", "14.513%"},
|
||||
{"Drawdown", "10.600%"},
|
||||
{"Expectancy", "0.066"},
|
||||
{"Net Profit", "14.513%"},
|
||||
{"Sharpe Ratio", "1.047"},
|
||||
{"Probabilistic Sharpe Ratio", "49.415%"},
|
||||
{"Loss Rate", "46%"},
|
||||
{"Win Rate", "54%"},
|
||||
{"Profit-Loss Ratio", "0.97"},
|
||||
{"Alpha", "0.124"},
|
||||
{"Beta", "-0.066"},
|
||||
{"Alpha", "0.135"},
|
||||
{"Beta", "-0.069"},
|
||||
{"Annual Standard Deviation", "0.121"},
|
||||
{"Annual Variance", "0.015"},
|
||||
{"Information Ratio", "0.006"},
|
||||
{"Tracking Error", "0.171"},
|
||||
{"Treynor Ratio", "-1.761"},
|
||||
{"Total Fees", "$8669.41"},
|
||||
{"Information Ratio", "0.033"},
|
||||
{"Tracking Error", "0.17"},
|
||||
{"Treynor Ratio", "-1.832"},
|
||||
{"Total Fees", "$7494.82"},
|
||||
{"Estimated Strategy Capacity", "$320000.00"},
|
||||
{"Fitness Score", "0.675"},
|
||||
{"Lowest Capacity Asset", "BNO UN3IMQ2JU1YD"},
|
||||
{"Fitness Score", "0.689"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "1.127"},
|
||||
{"Return Over Maximum Drawdown", "1.246"},
|
||||
{"Portfolio Turnover", "1.64"},
|
||||
{"Sortino Ratio", "1.226"},
|
||||
{"Return Over Maximum Drawdown", "1.367"},
|
||||
{"Portfolio Turnover", "1.627"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
@@ -224,7 +225,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "0b6746b5759ecd45ab21360fd40858bb"}
|
||||
{"OrderListHash", "6cf9ae04274be760ff10b47c718e9797"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,30 +160,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Trades", "5059"},
|
||||
{"Average Win", "0.08%"},
|
||||
{"Average Loss", "-0.08%"},
|
||||
{"Compounding Annual Return", "14.950%"},
|
||||
{"Drawdown", "10.600%"},
|
||||
{"Expectancy", "0.075"},
|
||||
{"Net Profit", "14.950%"},
|
||||
{"Sharpe Ratio", "1.072"},
|
||||
{"Probabilistic Sharpe Ratio", "50.327%"},
|
||||
{"Compounding Annual Return", "16.166%"},
|
||||
{"Drawdown", "10.500%"},
|
||||
{"Expectancy", "0.080"},
|
||||
{"Net Profit", "16.166%"},
|
||||
{"Sharpe Ratio", "1.157"},
|
||||
{"Probabilistic Sharpe Ratio", "53.509%"},
|
||||
{"Loss Rate", "45%"},
|
||||
{"Win Rate", "55%"},
|
||||
{"Profit-Loss Ratio", "0.97"},
|
||||
{"Alpha", "0.137"},
|
||||
{"Beta", "-0.066"},
|
||||
{"Profit-Loss Ratio", "0.96"},
|
||||
{"Alpha", "0.148"},
|
||||
{"Beta", "-0.068"},
|
||||
{"Annual Standard Deviation", "0.121"},
|
||||
{"Annual Variance", "0.015"},
|
||||
{"Information Ratio", "0.083"},
|
||||
{"Tracking Error", "0.171"},
|
||||
{"Treynor Ratio", "-1.971"},
|
||||
{"Total Fees", "$6806.67"},
|
||||
{"Information Ratio", "0.112"},
|
||||
{"Tracking Error", "0.17"},
|
||||
{"Treynor Ratio", "-2.041"},
|
||||
{"Total Fees", "$5872.38"},
|
||||
{"Estimated Strategy Capacity", "$320000.00"},
|
||||
{"Fitness Score", "0.694"},
|
||||
{"Lowest Capacity Asset", "BNO UN3IMQ2JU1YD"},
|
||||
{"Fitness Score", "0.709"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "1.265"},
|
||||
{"Return Over Maximum Drawdown", "1.409"},
|
||||
{"Portfolio Turnover", "1.296"},
|
||||
{"Sortino Ratio", "1.374"},
|
||||
{"Return Over Maximum Drawdown", "1.543"},
|
||||
{"Portfolio Turnover", "1.291"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
@@ -197,7 +198,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "a7a893a17a5afa7c2f73a444a7aea507"}
|
||||
{"OrderListHash", "de8d678cd9f488183e4f5bbd584f47e6"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,11 +106,12 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Beta", "0"},
|
||||
{"Annual Standard Deviation", "0"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-7.068"},
|
||||
{"Tracking Error", "0.193"},
|
||||
{"Information Ratio", "-7.163"},
|
||||
{"Tracking Error", "0.195"},
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", ""},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
|
||||
@@ -92,6 +92,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$14.92"},
|
||||
{"Estimated Strategy Capacity", "$85000.00"},
|
||||
{"Lowest Capacity Asset", "BTCEUR XJ"},
|
||||
{"Fitness Score", "0.258"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
|
||||
@@ -114,30 +114,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Trades", "5"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "-0.02%"},
|
||||
{"Compounding Annual Return", "-72.415%"},
|
||||
{"Drawdown", "2.800%"},
|
||||
{"Compounding Annual Return", "-72.241%"},
|
||||
{"Drawdown", "2.900%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "-1.749%"},
|
||||
{"Sharpe Ratio", "-3.059"},
|
||||
{"Probabilistic Sharpe Ratio", "21.811%"},
|
||||
{"Net Profit", "-1.740%"},
|
||||
{"Sharpe Ratio", "-2.982"},
|
||||
{"Probabilistic Sharpe Ratio", "22.311%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "-0.385"},
|
||||
{"Beta", "-0.146"},
|
||||
{"Annual Standard Deviation", "0.191"},
|
||||
{"Annual Variance", "0.036"},
|
||||
{"Information Ratio", "-6.701"},
|
||||
{"Tracking Error", "0.29"},
|
||||
{"Treynor Ratio", "4.005"},
|
||||
{"Total Fees", "$18.28"},
|
||||
{"Estimated Strategy Capacity", "$500000000.00"},
|
||||
{"Fitness Score", "0.052"},
|
||||
{"Alpha", "-0.387"},
|
||||
{"Beta", "-0.138"},
|
||||
{"Annual Standard Deviation", "0.195"},
|
||||
{"Annual Variance", "0.038"},
|
||||
{"Information Ratio", "-6.726"},
|
||||
{"Tracking Error", "0.294"},
|
||||
{"Treynor Ratio", "4.2"},
|
||||
{"Total Fees", "$19.23"},
|
||||
{"Estimated Strategy Capacity", "$540000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.054"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "-4.187"},
|
||||
{"Return Over Maximum Drawdown", "-25.473"},
|
||||
{"Portfolio Turnover", "0.998"},
|
||||
{"Sortino Ratio", "-4.058"},
|
||||
{"Return Over Maximum Drawdown", "-25.227"},
|
||||
{"Portfolio Turnover", "1"},
|
||||
{"Total Insights Generated", "1"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
@@ -151,7 +152,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "17245c38f1b192d2041ca1f3e88250be"}
|
||||
{"OrderListHash", "c548ae1a6ae4d75e832ed401881ddb21"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,46 +108,47 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "4"},
|
||||
{"Average Win", "0.96%"},
|
||||
{"Average Loss", "-0.95%"},
|
||||
{"Compounding Annual Return", "-44.357%"},
|
||||
{"Drawdown", "1.100%"},
|
||||
{"Expectancy", "0.005"},
|
||||
{"Net Profit", "-0.800%"},
|
||||
{"Sharpe Ratio", "-2.218"},
|
||||
{"Probabilistic Sharpe Ratio", "32.508%"},
|
||||
{"Average Win", "0.94%"},
|
||||
{"Average Loss", "-0.98%"},
|
||||
{"Compounding Annual Return", "-47.257%"},
|
||||
{"Drawdown", "1.200%"},
|
||||
{"Expectancy", "-0.021"},
|
||||
{"Net Profit", "-0.873%"},
|
||||
{"Sharpe Ratio", "-2.308"},
|
||||
{"Probabilistic Sharpe Ratio", "31.792%"},
|
||||
{"Loss Rate", "50%"},
|
||||
{"Win Rate", "50%"},
|
||||
{"Profit-Loss Ratio", "1.01"},
|
||||
{"Alpha", "-0.64"},
|
||||
{"Beta", "0.23"},
|
||||
{"Annual Standard Deviation", "0.147"},
|
||||
{"Annual Variance", "0.022"},
|
||||
{"Information Ratio", "-8.259"},
|
||||
{"Tracking Error", "0.204"},
|
||||
{"Treynor Ratio", "-1.424"},
|
||||
{"Total Fees", "$16.26"},
|
||||
{"Estimated Strategy Capacity", "$590000000.00"},
|
||||
{"Fitness Score", "0.003"},
|
||||
{"Kelly Criterion Estimate", "12.539"},
|
||||
{"Kelly Criterion Probability Value", "0.367"},
|
||||
{"Sortino Ratio", "-22.336"},
|
||||
{"Return Over Maximum Drawdown", "-38.722"},
|
||||
{"Portfolio Turnover", "1.003"},
|
||||
{"Profit-Loss Ratio", "0.96"},
|
||||
{"Alpha", "-0.675"},
|
||||
{"Beta", "0.232"},
|
||||
{"Annual Standard Deviation", "0.152"},
|
||||
{"Annual Variance", "0.023"},
|
||||
{"Information Ratio", "-8.38"},
|
||||
{"Tracking Error", "0.209"},
|
||||
{"Treynor Ratio", "-1.514"},
|
||||
{"Total Fees", "$17.19"},
|
||||
{"Estimated Strategy Capacity", "$640000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.002"},
|
||||
{"Kelly Criterion Estimate", "12.812"},
|
||||
{"Kelly Criterion Probability Value", "0.363"},
|
||||
{"Sortino Ratio", "-29.284"},
|
||||
{"Return Over Maximum Drawdown", "-40.149"},
|
||||
{"Portfolio Turnover", "1.004"},
|
||||
{"Total Insights Generated", "7"},
|
||||
{"Total Insights Closed", "4"},
|
||||
{"Total Insights Analysis Completed", "4"},
|
||||
{"Long Insight Count", "5"},
|
||||
{"Short Insight Count", "2"},
|
||||
{"Long/Short Ratio", "250.0%"},
|
||||
{"Estimated Monthly Alpha Value", "$19016880.2887"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$3275129.3830"},
|
||||
{"Mean Population Estimated Insight Value", "$818782.3458"},
|
||||
{"Estimated Monthly Alpha Value", "$21484919.5759"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$3700180.5936"},
|
||||
{"Mean Population Estimated Insight Value", "$925045.1484"},
|
||||
{"Mean Population Direction", "50%"},
|
||||
{"Mean Population Magnitude", "50%"},
|
||||
{"Rolling Averaged Population Direction", "50%"},
|
||||
{"Rolling Averaged Population Magnitude", "50%"},
|
||||
{"OrderListHash", "4178a84209934b1eb6d03c2267654f32"}
|
||||
{"OrderListHash", "de18d7406b7b5126fcb974f9d283aca0"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,33 +128,34 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "4"},
|
||||
{"Total Trades", "5"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "-0.91%"},
|
||||
{"Compounding Annual Return", "-99.755%"},
|
||||
{"Average Loss", "-1.82%"},
|
||||
{"Compounding Annual Return", "-99.936%"},
|
||||
{"Drawdown", "29.500%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "-7.463%"},
|
||||
{"Sharpe Ratio", "-0.605"},
|
||||
{"Probabilistic Sharpe Ratio", "34.850%"},
|
||||
{"Net Profit", "-9.054%"},
|
||||
{"Sharpe Ratio", "-0.666"},
|
||||
{"Probabilistic Sharpe Ratio", "30.662%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "-13.685"},
|
||||
{"Beta", "6.59"},
|
||||
{"Annual Standard Deviation", "1.632"},
|
||||
{"Annual Variance", "2.665"},
|
||||
{"Information Ratio", "-2.023"},
|
||||
{"Tracking Error", "1.441"},
|
||||
{"Treynor Ratio", "-0.15"},
|
||||
{"Total Fees", "$33.30"},
|
||||
{"Estimated Strategy Capacity", "$17000000.00"},
|
||||
{"Fitness Score", "0.079"},
|
||||
{"Alpha", "-12.77"},
|
||||
{"Beta", "5.937"},
|
||||
{"Annual Standard Deviation", "1.497"},
|
||||
{"Annual Variance", "2.242"},
|
||||
{"Information Ratio", "-2.283"},
|
||||
{"Tracking Error", "1.305"},
|
||||
{"Treynor Ratio", "-0.168"},
|
||||
{"Total Fees", "$37.00"},
|
||||
{"Estimated Strategy Capacity", "$16000000.00"},
|
||||
{"Lowest Capacity Asset", "GC VL5E74HP3EE5"},
|
||||
{"Fitness Score", "0.072"},
|
||||
{"Kelly Criterion Estimate", "-9.366"},
|
||||
{"Kelly Criterion Probability Value", "0.607"},
|
||||
{"Sortino Ratio", "-4.657"},
|
||||
{"Return Over Maximum Drawdown", "-5.203"},
|
||||
{"Portfolio Turnover", "4.377"},
|
||||
{"Sortino Ratio", "-5.173"},
|
||||
{"Return Over Maximum Drawdown", "-5.25"},
|
||||
{"Portfolio Turnover", "4.629"},
|
||||
{"Total Insights Generated", "10"},
|
||||
{"Total Insights Closed", "8"},
|
||||
{"Total Insights Analysis Completed", "8"},
|
||||
@@ -168,7 +169,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "25.058%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "f4c4b763b5ade918cfb7932e276d069f"}
|
||||
{"OrderListHash", "0f9f87f5c080b5ec0e48dac003a7e875"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,10 +86,10 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Trades", "2"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "-0.12%"},
|
||||
{"Compounding Annual Return", "-9.062%"},
|
||||
{"Compounding Annual Return", "-9.135%"},
|
||||
{"Drawdown", "0.100%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "-0.121%"},
|
||||
{"Net Profit", "-0.122%"},
|
||||
{"Sharpe Ratio", "0"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "100%"},
|
||||
@@ -99,16 +99,17 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Beta", "0"},
|
||||
{"Annual Standard Deviation", "0"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-8.769"},
|
||||
{"Tracking Error", "0.22"},
|
||||
{"Information Ratio", "-8.91"},
|
||||
{"Tracking Error", "0.223"},
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$6.41"},
|
||||
{"Total Fees", "$7.34"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", "IBM R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.249"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "-79.031"},
|
||||
{"Return Over Maximum Drawdown", "-78.999"},
|
||||
{"Portfolio Turnover", "0.498"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
@@ -123,7 +124,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "af92d7f4e0810bc4a95d5ccb5542b438"}
|
||||
{"OrderListHash", "8803eec75924fe5b021a1aec65ed2105"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,30 +167,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Trades", "250"},
|
||||
{"Average Win", "0.12%"},
|
||||
{"Average Loss", "-0.10%"},
|
||||
{"Compounding Annual Return", "-88.523%"},
|
||||
{"Drawdown", "3.400%"},
|
||||
{"Expectancy", "-0.238"},
|
||||
{"Net Profit", "-2.922%"},
|
||||
{"Sharpe Ratio", "-5.16"},
|
||||
{"Probabilistic Sharpe Ratio", "0.502%"},
|
||||
{"Compounding Annual Return", "-86.494%"},
|
||||
{"Drawdown", "3.300%"},
|
||||
{"Expectancy", "-0.225"},
|
||||
{"Net Profit", "-2.705%"},
|
||||
{"Sharpe Ratio", "-4.958"},
|
||||
{"Probabilistic Sharpe Ratio", "1.087%"},
|
||||
{"Loss Rate", "65%"},
|
||||
{"Win Rate", "35%"},
|
||||
{"Profit-Loss Ratio", "1.17"},
|
||||
{"Alpha", "-1.423"},
|
||||
{"Beta", "0.537"},
|
||||
{"Annual Standard Deviation", "0.134"},
|
||||
{"Profit-Loss Ratio", "1.20"},
|
||||
{"Alpha", "-1.401"},
|
||||
{"Beta", "0.525"},
|
||||
{"Annual Standard Deviation", "0.135"},
|
||||
{"Annual Variance", "0.018"},
|
||||
{"Information Ratio", "-16.652"},
|
||||
{"Tracking Error", "0.123"},
|
||||
{"Treynor Ratio", "-1.288"},
|
||||
{"Total Fees", "$669.76"},
|
||||
{"Estimated Strategy Capacity", "$210000.00"},
|
||||
{"Fitness Score", "0.021"},
|
||||
{"Information Ratio", "-16.23"},
|
||||
{"Tracking Error", "0.127"},
|
||||
{"Treynor Ratio", "-1.27"},
|
||||
{"Total Fees", "$670.68"},
|
||||
{"Estimated Strategy Capacity", "$190000.00"},
|
||||
{"Lowest Capacity Asset", "IBM R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.023"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "-7.372"},
|
||||
{"Return Over Maximum Drawdown", "-30.295"},
|
||||
{"Portfolio Turnover", "49.96"},
|
||||
{"Sortino Ratio", "-6.961"},
|
||||
{"Return Over Maximum Drawdown", "-31.972"},
|
||||
{"Portfolio Turnover", "49.956"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
@@ -204,7 +205,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "2cd87d138f8f9f5fcab28b6f983f68b1"}
|
||||
{"OrderListHash", "a832e5f029696f1cf0b9f7964978164e"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,33 +127,34 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
|
||||
{
|
||||
{"Total Trades", "20"},
|
||||
{"Total Trades", "18"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0.00%"},
|
||||
{"Compounding Annual Return", "-74.182%"},
|
||||
{"Drawdown", "2.200%"},
|
||||
{"Compounding Annual Return", "-74.117%"},
|
||||
{"Drawdown", "2.500%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "-1.046%"},
|
||||
{"Net Profit", "-1.044%"},
|
||||
{"Sharpe Ratio", "-8.269"},
|
||||
{"Probabilistic Sharpe Ratio", "0%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "-0.19"},
|
||||
{"Beta", "0.579"},
|
||||
{"Alpha", "-0.187"},
|
||||
{"Beta", "0.584"},
|
||||
{"Annual Standard Deviation", "0.065"},
|
||||
{"Annual Variance", "0.004"},
|
||||
{"Information Ratio", "1.326"},
|
||||
{"Tracking Error", "0.049"},
|
||||
{"Treynor Ratio", "-0.934"},
|
||||
{"Total Fees", "$22.26"},
|
||||
{"Estimated Strategy Capacity", "$360000.00"},
|
||||
{"Information Ratio", "1.354"},
|
||||
{"Tracking Error", "0.048"},
|
||||
{"Treynor Ratio", "-0.926"},
|
||||
{"Total Fees", "$20.45"},
|
||||
{"Estimated Strategy Capacity", "$350000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.002"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "-11.855"},
|
||||
{"Return Over Maximum Drawdown", "-70.945"},
|
||||
{"Portfolio Turnover", "0.342"},
|
||||
{"Sortino Ratio", "-11.829"},
|
||||
{"Return Over Maximum Drawdown", "-71.014"},
|
||||
{"Portfolio Turnover", "0.341"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
@@ -167,7 +168,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "9f381f81ea9939f285b432207fa0d024"}
|
||||
{"OrderListHash", "fbefbed1d94294a14bc563a71b336056"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,30 +105,31 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Trades", "4"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "8.332%"},
|
||||
{"Compounding Annual Return", "7.848%"},
|
||||
{"Drawdown", "0.100%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "0.106%"},
|
||||
{"Sharpe Ratio", "7.474"},
|
||||
{"Probabilistic Sharpe Ratio", "85.145%"},
|
||||
{"Net Profit", "0.100%"},
|
||||
{"Sharpe Ratio", "7.449"},
|
||||
{"Probabilistic Sharpe Ratio", "85.066%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "0.007"},
|
||||
{"Beta", "0.036"},
|
||||
{"Alpha", "0.006"},
|
||||
{"Beta", "0.033"},
|
||||
{"Annual Standard Deviation", "0.007"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "-7.03"},
|
||||
{"Tracking Error", "0.186"},
|
||||
{"Treynor Ratio", "1.557"},
|
||||
{"Information Ratio", "-7.131"},
|
||||
{"Tracking Error", "0.189"},
|
||||
{"Treynor Ratio", "1.576"},
|
||||
{"Total Fees", "$4.00"},
|
||||
{"Estimated Strategy Capacity", "$5200000.00"},
|
||||
{"Fitness Score", "0.012"},
|
||||
{"Estimated Strategy Capacity", "$6000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.011"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "38.663"},
|
||||
{"Return Over Maximum Drawdown", "238.773"},
|
||||
{"Portfolio Turnover", "0.012"},
|
||||
{"Sortino Ratio", "38.493"},
|
||||
{"Return Over Maximum Drawdown", "236.57"},
|
||||
{"Portfolio Turnover", "0.011"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
{"Total Insights Analysis Completed", "0"},
|
||||
@@ -142,7 +143,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "ee79a87e6a386f5ee620d77b7bfbd964"}
|
||||
{"OrderListHash", "65e705bf0e78139c376903d4ff241afc"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,6 +175,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$804.33"},
|
||||
{"Estimated Strategy Capacity", "$11000.00"},
|
||||
{"Lowest Capacity Asset", "BTCEUR XJ"},
|
||||
{"Fitness Score", "0.504"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
|
||||
@@ -98,7 +98,8 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Tracking Error", "0"},
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$5.93"},
|
||||
{"Estimated Strategy Capacity", "$590000.00"},
|
||||
{"Estimated Strategy Capacity", "$150000.00"},
|
||||
{"Lowest Capacity Asset", "SHY 2T"},
|
||||
{"Fitness Score", "0.499"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
|
||||
@@ -145,6 +145,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", ""},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
|
||||
@@ -88,29 +88,30 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Trades", "1"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0%"},
|
||||
{"Compounding Annual Return", "500.622%"},
|
||||
{"Compounding Annual Return", "480.907%"},
|
||||
{"Drawdown", "0.300%"},
|
||||
{"Expectancy", "0"},
|
||||
{"Net Profit", "1.984%"},
|
||||
{"Sharpe Ratio", "14.933"},
|
||||
{"Probabilistic Sharpe Ratio", "90.520%"},
|
||||
{"Net Profit", "1.947%"},
|
||||
{"Sharpe Ratio", "14.546"},
|
||||
{"Probabilistic Sharpe Ratio", "90.065%"},
|
||||
{"Loss Rate", "0%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "2.211"},
|
||||
{"Alpha", "2.13"},
|
||||
{"Beta", "-0.467"},
|
||||
{"Annual Standard Deviation", "0.166"},
|
||||
{"Annual Variance", "0.028"},
|
||||
{"Information Ratio", "7.778"},
|
||||
{"Tracking Error", "0.394"},
|
||||
{"Treynor Ratio", "-5.313"},
|
||||
{"Total Fees", "$5.40"},
|
||||
{"Estimated Strategy Capacity", "$230000000.00"},
|
||||
{"Annual Standard Deviation", "0.165"},
|
||||
{"Annual Variance", "0.027"},
|
||||
{"Information Ratio", "7.676"},
|
||||
{"Tracking Error", "0.389"},
|
||||
{"Treynor Ratio", "-5.146"},
|
||||
{"Total Fees", "$22.30"},
|
||||
{"Estimated Strategy Capacity", "$250000000.00"},
|
||||
{"Lowest Capacity Asset", "AAPL R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0.244"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
{"Sortino Ratio", "79228162514264337593543950335"},
|
||||
{"Return Over Maximum Drawdown", "1748.254"},
|
||||
{"Return Over Maximum Drawdown", "1678.959"},
|
||||
{"Portfolio Turnover", "0.244"},
|
||||
{"Total Insights Generated", "0"},
|
||||
{"Total Insights Closed", "0"},
|
||||
@@ -125,7 +126,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Mean Population Magnitude", "0%"},
|
||||
{"Rolling Averaged Population Direction", "0%"},
|
||||
{"Rolling Averaged Population Magnitude", "0%"},
|
||||
{"OrderListHash", "189eee984d524162b9676b83dab4d73c"}
|
||||
{"OrderListHash", "0732bfb026b22c9717a08ddfe7bb0e46"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,11 +149,12 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Beta", "0"},
|
||||
{"Annual Standard Deviation", "0"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "5.853"},
|
||||
{"Tracking Error", "0.107"},
|
||||
{"Information Ratio", "5.865"},
|
||||
{"Tracking Error", "0.106"},
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", ""},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
|
||||
@@ -153,11 +153,12 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Beta", "0"},
|
||||
{"Annual Standard Deviation", "0"},
|
||||
{"Annual Variance", "0"},
|
||||
{"Information Ratio", "5.853"},
|
||||
{"Tracking Error", "0.107"},
|
||||
{"Information Ratio", "5.865"},
|
||||
{"Tracking Error", "0.106"},
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$0.00"},
|
||||
{"Estimated Strategy Capacity", "$0"},
|
||||
{"Lowest Capacity Asset", ""},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
|
||||
@@ -119,6 +119,7 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Treynor Ratio", "0"},
|
||||
{"Total Fees", "$2651.01"},
|
||||
{"Estimated Strategy Capacity", "$30000.00"},
|
||||
{"Lowest Capacity Asset", "BTCUSD XJ"},
|
||||
{"Fitness Score", "0.467"},
|
||||
{"Kelly Criterion Estimate", "0"},
|
||||
{"Kelly Criterion Probability Value", "0"},
|
||||
|
||||
@@ -82,28 +82,29 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Total Trades", "2"},
|
||||
{"Average Win", "0%"},
|
||||
{"Average Loss", "0.00%"},
|
||||
{"Compounding Annual Return", "8.172%"},
|
||||
{"Drawdown", "55.100%"},
|
||||
{"Compounding Annual Return", "8.171%"},
|
||||
{"Drawdown", "55.000%"},
|
||||
{"Expectancy", "-1"},
|
||||
{"Net Profit", "125.433%"},
|
||||
{"Sharpe Ratio", "0.468"},
|
||||
{"Probabilistic Sharpe Ratio", "2.573%"},
|
||||
{"Net Profit", "125.420%"},
|
||||
{"Sharpe Ratio", "0.469"},
|
||||
{"Probabilistic Sharpe Ratio", "2.603%"},
|
||||
{"Loss Rate", "100%"},
|
||||
{"Win Rate", "0%"},
|
||||
{"Profit-Loss Ratio", "0"},
|
||||
{"Alpha", "0.093"},
|
||||
{"Beta", "-0.099"},
|
||||
{"Annual Standard Deviation", "0.18"},
|
||||
{"Alpha", "0.092"},
|
||||
{"Beta", "-0.091"},
|
||||
{"Annual Standard Deviation", "0.179"},
|
||||
{"Annual Variance", "0.032"},
|
||||
{"Information Ratio", "-0.001"},
|
||||
{"Tracking Error", "0.267"},
|
||||
{"Treynor Ratio", "-0.847"},
|
||||
{"Total Fees", "$41.17"},
|
||||
{"Estimated Strategy Capacity", "$340000000.00"},
|
||||
{"Tracking Error", "0.265"},
|
||||
{"Treynor Ratio", "-0.927"},
|
||||
{"Total Fees", "$43.46"},
|
||||
{"Estimated Strategy Capacity", "$430000000.00"},
|
||||
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
|
||||
{"Fitness Score", "0"},
|
||||
{"Kelly Criterion Estimate", "38.884"},
|
||||
{"Kelly Criterion Probability Value", "0.009"},
|
||||
{"Sortino Ratio", "0.501"},
|
||||
{"Kelly Criterion Estimate", "37.332"},
|
||||
{"Kelly Criterion Probability Value", "0.01"},
|
||||
{"Sortino Ratio", "0.505"},
|
||||
{"Return Over Maximum Drawdown", "0.148"},
|
||||
{"Portfolio Turnover", "0"},
|
||||
{"Total Insights Generated", "2604"},
|
||||
@@ -112,14 +113,14 @@ namespace QuantConnect.Algorithm.CSharp
|
||||
{"Long Insight Count", "2604"},
|
||||
{"Short Insight Count", "0"},
|
||||
{"Long/Short Ratio", "100%"},
|
||||
{"Estimated Monthly Alpha Value", "$1176372.2118"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$148113430.7231"},
|
||||
{"Mean Population Estimated Insight Value", "$56901.0491"},
|
||||
{"Mean Population Direction", "43.2962%"},
|
||||
{"Mean Population Magnitude", "43.2962%"},
|
||||
{"Rolling Averaged Population Direction", "48.763%"},
|
||||
{"Rolling Averaged Population Magnitude", "48.763%"},
|
||||
{"OrderListHash", "0ae9067022a716a31e7bc1cd6dbc3746"}
|
||||
{"Estimated Monthly Alpha Value", "$1220785.7706"},
|
||||
{"Total Accumulated Estimated Alpha Value", "$153705406.1995"},
|
||||
{"Mean Population Estimated Insight Value", "$59049.3301"},
|
||||
{"Mean Population Direction", "43.4499%"},
|
||||
{"Mean Population Magnitude", "43.4499%"},
|
||||
{"Rolling Averaged Population Direction", "48.5717%"},
|
||||
{"Rolling Averaged Population Magnitude", "48.5717%"},
|
||||
{"OrderListHash", "3aa1d64da57ef9841bef4aa8b0292521"}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user